code: def handle_button(self, event, event_type):
          
          mouse_button_number = self._get_mouse_button_number(event)
          # Identify buttons 3,4,5
          if event_type in (25, 26):
              event_type = event_type + (mouse_button_number * 0.1)
          # Add buttons to events
          event_type_name, event_code, value, scan = self.codes[event_type]
          if event_type_name == "Key":
              scan_event, key_event = self.emulate_press(
                  event_code, scan, value, self.timeval)
              self.events.append(scan_event)
              self.events.append(key_event)
docs: Handle mouse click.