aboutsummaryrefslogtreecommitdiff
path: root/src/splitscreen_duo/input.py
diff options
context:
space:
mode:
authorZoltan Szabatin <[email protected]>2025-03-05 20:05:42 -0800
committerZoltan Szabatin <[email protected]>2025-03-05 20:05:42 -0800
commita477eff23a127cc074412af7ec983414563c0935 (patch)
tree13a58c2b097d5768638160b15cfc7f7782c2b864 /src/splitscreen_duo/input.py
parentchore(Git): Ignore macOS-specific files (diff)
downloadsplitscreen-duo-a477eff23a127cc074412af7ec983414563c0935.tar.xz
splitscreen-duo-a477eff23a127cc074412af7ec983414563c0935.zip
fix(Input): Controller button indexes
Diffstat (limited to 'src/splitscreen_duo/input.py')
-rw-r--r--src/splitscreen_duo/input.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/splitscreen_duo/input.py b/src/splitscreen_duo/input.py
index a9c13c3..769a5e5 100644
--- a/src/splitscreen_duo/input.py
+++ b/src/splitscreen_duo/input.py
@@ -71,10 +71,22 @@ class Input:
if event.value[1] == -1: # D-pad down
return "DOWN"
elif event.type == pygame.JOYBUTTONDOWN:
- if event.button == 0: # Button A or select
+ if event.button == 0:
+ return "DOWN"
+
+ if event.button == 1:
+ return "LEFT"
+
+ if event.button == 2:
+ return "UP"
+
+ if event.button == 3:
+ return "RIGHT"
+
+ if event.button == 4:
return "SELECT"
- if event.button == 1: # Button B
- return "QUIT"
+ if event.button == 5:
+ return "START"
return None