From c741ec223f88a1bcc8677019e717ad2b6d379453 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 9 Feb 2023 06:29:16 +0300 Subject: [PATCH] engine: client: keys: reserve some more buttons as gamepad buttons according to latest SDL2 GameController header --- engine/client/keys.c | 14 +++++++------- engine/keydefs.h | 12 ++++++++++++ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/engine/client/keys.c b/engine/client/keys.c index f1c0d688..7a53da72 100644 --- a/engine/client/keys.c +++ b/engine/client/keys.c @@ -123,13 +123,13 @@ keyname_t keynames[] = {"JOY4" , K_JOY4 , ""}, {"C_BUTTON", K_C_BUTTON, ""}, {"Z_BUTTON", K_Z_BUTTON, ""}, -{"AUX20", K_AUX20, ""}, // generic -{"AUX21", K_AUX21, ""}, -{"AUX22", K_AUX22, ""}, -{"AUX23", K_AUX23, ""}, -{"AUX24", K_AUX24, ""}, -{"AUX25", K_AUX25, ""}, -{"AUX26", K_AUX26, ""}, +{"MISC_BUTTON", K_MISC_BUTTON, ""}, +{"PADDLE1", K_PADDLE1_BUTTON, ""}, +{"PADDLE2", K_PADDLE2_BUTTON, ""}, +{"PADDLE3", K_PADDLE3_BUTTON, ""}, +{"PADDLE4", K_PADDLE4_BUTTON, ""}, +{"TOUCHPAD", K_TOUCHPAD, ""}, +{"AUX26", K_AUX26, ""}, // generic {"AUX27", K_AUX27, ""}, {"AUX28", K_AUX28, ""}, {"AUX29", K_AUX29, ""}, diff --git a/engine/keydefs.h b/engine/keydefs.h index 6bce443a..61c5e03e 100644 --- a/engine/keydefs.h +++ b/engine/keydefs.h @@ -145,11 +145,23 @@ #define K_DPAD_RIGHT K_AUX19 #define K_AUX20 226 +#define K_MISC_BUTTON K_AUX20 // Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button + #define K_AUX21 227 +#define K_PADDLE1_BUTTON K_AUX21 // Xbox Elite paddle P1-P4 + #define K_AUX22 228 +#define K_PADDLE2_BUTTON K_AUX22 + #define K_AUX23 229 +#define K_PADDLE3_BUTTON K_AUX23 + #define K_AUX24 230 +#define K_PADDLE4_BUTTON K_AUX24 + #define K_AUX25 231 +#define K_TOUCHPAD K_AUX25 // PS4/PS5 touchpad button + #define K_AUX26 232 #define K_AUX27 233 #define K_AUX28 234