code: def key_press_handler(event, canvas, toolbar=None):
      
      if event.key is None: return
  
      key = event.key.encode('ascii', 'ignore')
  
      if key in ['1']:
          toolbar.create_gate_widget(kind='poly')
      elif key in ['2', '3', '4']:
          kind = {'2': 'quad', '3': 'horizontal threshold', '4': 'vertical threshold'}[key]
          toolbar.create_gate_widget(kind=kind)
      elif key in ['9']:
          toolbar.remove_active_gate()
      elif key in ['0']:
          toolbar.load_fcs()
      elif key in ['a']:
          toolbar.set_axes(('d1', 'd2'), pl.gca())
      elif key in ['b']:
          toolbar.set_axes(('d2', 'd1'), pl.gca())
      elif key in ['c']:
          toolbar.set_axes(('d1', 'd3'), pl.gca())
      elif key in ['8']:
          print(toolbar.get_generation_code())
docs: Handles keyboard shortcuts for the FCToolbar.