diff --git a/Quake/in_sdl.c b/Quake/in_sdl.c index bdec6cde2..69f4f2d6c 100644 --- a/Quake/in_sdl.c +++ b/Quake/in_sdl.c @@ -362,6 +362,11 @@ void IN_ShutdownJoystick (void) SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER); } +qboolean IN_HasGamepad (void) +{ + return joy_active_controller != NULL; +} + void IN_GyroActionDown (void) { switch ((int)gyro_mode.value) diff --git a/Quake/input.h b/Quake/input.h index 1c9a19c1f..352460fe7 100644 --- a/Quake/input.h +++ b/Quake/input.h @@ -39,6 +39,7 @@ qboolean IN_HasGyro (void); void IN_StartGyroCalibration (void); qboolean IN_IsCalibratingGyro (void); +qboolean IN_HasGamepad (void); void IN_SendKeyEvents (void); // used as a callback for Sys_SendKeyEvents() by some drivers diff --git a/Quake/menu.c b/Quake/menu.c index 124d85c5f..b232af017 100644 --- a/Quake/menu.c +++ b/Quake/menu.c @@ -4553,7 +4553,12 @@ void M_Keys_Draw (void) if (bind_grab) M_Print (12, y + 32, "Press a key or button for this action"); else - M_Print (18, y + 32, "Enter to change, backspace to clear"); + { + const char *msg = IN_HasGamepad () ? + "Enter/A to change, backspace/Y to clear" : + "Enter to change, backspace to clear"; + M_PrintAligned (160, y + 32, ALIGN_CENTER, msg); + } y += KEYLIST_OFS; @@ -4678,6 +4683,7 @@ void M_Keys_Key (int k) break; /* fall-through */ case K_DEL: + case K_YBUTTON: M_ThrottledSound ("misc/menu2.wav"); M_UnbindCommand (bindnames[keysmenu.list.cursor][0]); break;