code: def on_mouse_move(event):
      global throttle
      # throttle mouse events to 50ms
      if time.monotonic() - throttle < 0.05:
          return
      throttle = time.monotonic()
  
      # adjust the event position for hidpi screens
      render_size = tuple(d * canvas.pixel_scale for d in canvas.size)
      x_pos = event.pos[0] * canvas.pixel_scale
      y_pos = render_size[1] - (event.pos[1] * canvas.pixel_scale)
  
      # render a small patch around the mouse cursor
      restore_state = not face_picking_filter.enabled
      face_picking_filter.enabled = True
      mesh.update_gl_state(blend=False)
      picking_render = canvas.render(
          region=(x_pos - 1, y_pos - 1, 3, 3),
          size=(3, 3),
          bgcolor=(0, 0, 0, 0),
          alpha=True,
      )
      if restore_state:
          face_picking_filter.enabled = False
      mesh.update_gl_state(blend=not face_picking_filter.enabled)
  
      # unpack the face index from the color in the center pixel
      face_idx = (picking_render.view(np.uint32) - 1)[1, 1, 0]
  
      if face_idx > 0 and face_idx < len(face_colors):
          # this may be less safe, but it's faster than set_data
          mesh.mesh_data._face_colors_indexed_by_faces[face_idx] = (
              0,
              1,
              0,
              1,
          )
          mesh.mesh_data_changed()
  
file_path: vispy/examples/scene/face_picking.py
imports: import argparse
  import itertools
  import time
  import numpy
  from vispy import app, scene
  from vispy.io import read_mesh, load_data_file
  from vispy.scene.visuals import Mesh
  from vispy.scene import transforms
  from vispy.visuals.filters import ShadingFilter, WireframeFilter, FacePickingFilter
label_desc: Use image node_id 2 for calling a global function with example usage: on_mouse_move(event) without return types