Skip to content

Commit

Permalink
Add support for more controller buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-drexler committed Dec 30, 2023
1 parent 323ef19 commit a8be9b1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Quake/in_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,12 @@ static int IN_KeyForControllerButton(SDL_GameControllerButton button)
case SDL_CONTROLLER_BUTTON_DPAD_DOWN: return K_DOWNARROW;
case SDL_CONTROLLER_BUTTON_DPAD_LEFT: return K_LEFTARROW;
case SDL_CONTROLLER_BUTTON_DPAD_RIGHT: return K_RIGHTARROW;
case SDL_CONTROLLER_BUTTON_MISC1: return K_MISC1;
case SDL_CONTROLLER_BUTTON_PADDLE1: return K_PADDLE1;
case SDL_CONTROLLER_BUTTON_PADDLE2: return K_PADDLE2;
case SDL_CONTROLLER_BUTTON_PADDLE3: return K_PADDLE3;
case SDL_CONTROLLER_BUTTON_PADDLE4: return K_PADDLE4;
case SDL_CONTROLLER_BUTTON_TOUCHPAD: return K_TOUCHPAD;
default: return 0;
}
}
Expand Down
6 changes: 6 additions & 0 deletions Quake/keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ static const keyname_t keynames[] =
{"YBUTTON", K_YBUTTON},
{"LTRIGGER", K_LTRIGGER},
{"RTRIGGER", K_RTRIGGER},
{"MISC1", K_MISC1},
{"PADDLE1", K_PADDLE1},
{"PADDLE2", K_PADDLE2},
{"PADDLE3", K_PADDLE3},
{"PADDLE4", K_PADDLE4},
{"TOUCHPAD", K_TOUCHPAD},

{NULL, 0}
};
Expand Down
6 changes: 6 additions & 0 deletions Quake/keys.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ typedef enum keycode_t
K_YBUTTON,
K_LTRIGGER,
K_RTRIGGER,
K_MISC1,
K_PADDLE1,
K_PADDLE2,
K_PADDLE3,
K_PADDLE4,
K_TOUCHPAD,

K_PAUSE,

Expand Down

0 comments on commit a8be9b1

Please sign in to comment.