code: def on_key_press(self, event):
      if event.text == " ":
          if self.timer.running:
              self.timer.stop()
          else:
              self.timer.start()
  
file_path: vispy/examples/gloo/display_lines.py
imports: import numpy
  from vispy import gloo
  from vispy import app
  from vispy.util.transforms import perspective, translate, rotate
label_desc: Use image node_id 2 for calling the Canvas obj's underlying member method code with example usage: obj.on_key_press(event) without return types