code: def on_key(self, view, key, event):
          
          d = self.declaration
          r = {'key': key, 'result': False}
          d.key_event(r)
          return r['result']
docs: Trigger the key event
  
          Parameters
          ----------
          view: int
              The ID of the view that sent this event
          key: int
              The code of the key that was pressed
          data: bytes
              The msgpack encoded key event