code: def handle_input(self):
          
          difference = self.check_state()
          if not difference:
              return
          self.events = []
          self.handle_new_events(difference)
          self.update_timeval()
          self.events.append(self.sync_marker(self.timeval))
          self.write_to_pipe(self.events)
docs: Sends differences in the device state to the MicroBitPad
          as events.