code: def test_plot_epochs_keypresses(epochs_full, browser_backend):
      """Test plot_epochs keypress interaction."""
      # we need more than 1 epoch
      epochs_full.drop_bad(
          dict(mag=4e-12)
      )  # for histogram plot coverage
      fig = epochs_full.plot(n_epochs=3)
      # make sure green vlines are visible first (for coverage)
      sample_idx = (
          len(epochs_full.times) // 2
      )  # halfway through the first epoch
      x = fig.mne.traces[0].get_xdata()[sample_idx]
      y = (
          fig.mne.traces[0].get_ydata()[sample_idx]
          + fig.mne.traces[1].get_ydata()[sample_idx]
      ) / 2
      fig._fake_click([x, y], xform="data")  # click between traces
      # test keys
      keys = (
          "pagedown",
          "down",
          "up",
          "down",
          "right",
          "left",
          "-",
          "+",
          "=",
          "d",
          "d",
          "pageup",
          "home",
          "shift+right",
          "end",
          "shift+left",
          "z",
          "z",
          "s",
          "s",
          "?",
          "h",
          "j",
          "b",
      )
      for key in (
          keys * 2
      ):  # test twice → once in normal, once in butterfly view
          fig._fake_keypress(key)
      fig._fake_click([x, y], xform="data", button=3)
  
imports: import platform
  import matplotlib.pyplot
  import numpy
  import pytest
  from mne import Epochs, EpochsArray, create_info
  from mne.datasets import testing
  from mne.event import make_fixed_length_events
  from mne.viz import plot_drop_log
label_desc: Use image node_id 7 for calling a global function with example usage: test_plot_epochs_keypresses(epochs_full, browser_backend) without return types