Skip to content

Commit

Permalink
fixed Gamepad Python bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Nokse22 committed Oct 9, 2024
1 parent a91dfad commit f392b28
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Gamepad/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def on_absolute_axis_event(device, event):
print(f"{device.get_name()}: moved axis {axis} to {value}")


def on_device(device):
def on_device(_, device):
print("Device connected:", device.get_name())

# Face and Shoulder Buttons
Expand All @@ -65,11 +65,11 @@ def on_device(device):
stack.set_visible_child_name("watch")


def on_device_disconnected(device):
def on_device_disconnected(_, device):
print(f"Device Disconnected: {device.get_name()}")

devices.remove(device)
stack.set_visible_child_name("connect" if devices.size < 1 else "watch")
stack.set_visible_child_name("connect" if len(devices) < 1 else "watch")


monitor = Manette.Monitor()
Expand All @@ -78,7 +78,7 @@ def on_device_disconnected(device):
while True:
has_next, device = monitor_iter.next()
if device:
on_device(device)
on_device(None, device)
if not has_next:
break

Expand Down

0 comments on commit f392b28

Please sign in to comment.