gamepad: support extra buttons

This commit is contained in:
Andrei Alexeyev 2022-01-08 18:22:44 +02:00
parent c3382e6b05
commit 4661c9609c
No known key found for this signature in database
GPG key ID: 72D26128040B9690
2 changed files with 12 additions and 0 deletions

View file

@ -837,6 +837,12 @@ static const char *const gamepad_button_names[GAMEPAD_BUTTON_MAX] = {
[GAMEPAD_BUTTON_DPAD_DOWN] = "Down",
[GAMEPAD_BUTTON_DPAD_LEFT] = "Left",
[GAMEPAD_BUTTON_DPAD_RIGHT] = "Right",
[GAMEPAD_BUTTON_MISC1] = "Misc",
[GAMEPAD_BUTTON_P1] = "P1",
[GAMEPAD_BUTTON_P2] = "P2",
[GAMEPAD_BUTTON_P3] = "P3",
[GAMEPAD_BUTTON_P4] = "P4",
[GAMEPAD_BUTTON_TOUCHPAD] = "Touchpad",
};
static const char *const gamepad_emulated_button_names[GAMEPAD_EMULATED_BUTTON_MAX] = {

View file

@ -65,6 +65,12 @@ typedef enum GamepadButton {
GAMEPAD_BUTTON_DPAD_DOWN,
GAMEPAD_BUTTON_DPAD_LEFT,
GAMEPAD_BUTTON_DPAD_RIGHT,
GAMEPAD_BUTTON_MISC1,
GAMEPAD_BUTTON_P1,
GAMEPAD_BUTTON_P2,
GAMEPAD_BUTTON_P3,
GAMEPAD_BUTTON_P4,
GAMEPAD_BUTTON_TOUCHPAD,
GAMEPAD_BUTTON_MAX,
GAMEPAD_BUTTON_EMULATED = 0x8000,