code: def on_key_press(event):
      if event.text == "1":
          methods = ["mip", "average"]
          method = methods[(methods.index(plane.method) + 1) % 2]
          print("Volume render method: %s" % method)
          plane.method = method
      elif event.text == "2":
          modes = ["volume", "plane"]
          if plane.raycasting_mode == modes[0]:
              plane.raycasting_mode = modes[1]
              print(modes[1])
          else:
              plane.raycasting_mode = modes[0]
              print(modes[0])
      elif event.text != "" and event.text in "{}":
          t = -1 if event.text == "{" else 1
          plane.plane_thickness += t
          plane.plane_thickness += t
          print(f"plane thickness: {plane.plane_thickness}")
      elif event.text != "" and event.text in "[]":
          shift = plane.plane_normal / np.linalg.norm(
              plane.plane_normal
          )
          if event.text == "[":
              plane.plane_position -= 2 * shift
          elif event.text == "]":
              plane.plane_position += 2 * shift
          print(f"plane position: {plane.plane_position}")
      elif event.text == "x":
          plane.plane_normal = [0, 0, 1]
      elif event.text == "y":
          plane.plane_normal = [0, 1, 0]
      elif event.text == "z":
          plane.plane_normal = [1, 0, 0]
      elif event.text == "o":
          plane.plane_normal = [1, 1, 1]
      elif event.text == " ":
          if timer.running:
              timer.stop()
          else:
              timer.start()
  
file_path: vispy/examples/scene/volume_plane.py
imports: import sys
  import numpy
  from vispy import app, scene, io
  from vispy.visuals.transforms import STTransform
label_desc: Use image node_id 3 for calling a global function with example usage: on_key_press(event) without return types