code: def handle_input(self, proxy, event_type, event, refcon):
          
          self.update_timeval()
          self.events = []
  
          if event_type in (1, 2, 3, 4, 25, 26, 27):
              self.handle_button(event, event_type)
  
          if event_type == 22:
              self.handle_scrollwheel(event)
  
          # Add in the absolute position of the mouse cursor
          self.handle_absolute(event)
  
          # Add in the relative position of the mouse cursor
          self.handle_relative(event)
  
          # End with a sync marker
          self.events.append(self.sync_marker(self.timeval))
  
          # We are done
          self.write_to_pipe(self.events)
docs: Handle an input event.