Sync before processing power/brake data

This commit is contained in:
Marc Riera 2022-11-18 20:09:49 +01:00
parent bed298ac99
commit 52a34383cc

View file

@ -240,6 +240,7 @@ class ClassicGamepad(PhysicalGamepad):
input_events.append(InputEvent(InputEvent.EventType(self.Buttons.BUTTON_C in self.buttons), InputEvent.Button.BUTTON_C)) input_events.append(InputEvent(InputEvent.EventType(self.Buttons.BUTTON_C in self.buttons), InputEvent.Button.BUTTON_C))
input_events.append(InputEvent(InputEvent.EventType(self.Buttons.BUTTON_SELECT in self.buttons), InputEvent.Button.BUTTON_SELECT)) input_events.append(InputEvent(InputEvent.EventType(self.Buttons.BUTTON_SELECT in self.buttons), InputEvent.Button.BUTTON_SELECT))
input_events.append(InputEvent(InputEvent.EventType(self.Buttons.BUTTON_START in self.buttons), InputEvent.Button.BUTTON_START)) input_events.append(InputEvent(InputEvent.EventType(self.Buttons.BUTTON_START in self.buttons), InputEvent.Button.BUTTON_START))
if event.type == evdev.ecodes.EV_SYN:
match self.power: match self.power:
case 6: case 6:
input_events.append(InputEvent(InputEvent.EventType.POWER_NOTCH, 0)) input_events.append(InputEvent(InputEvent.EventType.POWER_NOTCH, 0))