diff options
| author | Zoltan Szabatin <[email protected]> | 2025-03-05 20:05:42 -0800 |
|---|---|---|
| committer | Zoltan Szabatin <[email protected]> | 2025-03-05 20:05:42 -0800 |
| commit | a477eff23a127cc074412af7ec983414563c0935 (patch) | |
| tree | 13a58c2b097d5768638160b15cfc7f7782c2b864 /src | |
| parent | chore(Git): Ignore macOS-specific files (diff) | |
| download | splitscreen-duo-a477eff23a127cc074412af7ec983414563c0935.tar.xz splitscreen-duo-a477eff23a127cc074412af7ec983414563c0935.zip | |
fix(Input): Controller button indexes
Diffstat (limited to 'src')
| -rw-r--r-- | src/splitscreen_duo/input.py | 18 | ||||
| -rw-r--r-- | src/splitscreen_duo/menu.py | 2 |
2 files changed, 16 insertions, 4 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 diff --git a/src/splitscreen_duo/menu.py b/src/splitscreen_duo/menu.py index 18dcca6..eab3eec 100644 --- a/src/splitscreen_duo/menu.py +++ b/src/splitscreen_duo/menu.py @@ -25,7 +25,7 @@ def init_display(): FONT = pygame.font.Font(None, 36) screen = pygame.display.set_mode( (WIDTH, HEIGHT) if IS_DEVELOPMENT_MODE else (0, 0), - pygame.RESIZABLE if IS_DEVELOPMENT_MODE else pygame.FULLSCREEN, + # pygame.RESIZABLE if IS_DEVELOPMENT_MODE else pygame.FULLSCREEN, ) selected_index = 0 |