ref: a1f5c6ff94245e99a49042f564d3f28ec436282a
parent: 99fecdb9392be2cc7d9a8b55ce500e524f88aa5f
author: smootalicious <smootalicious@gmail.com>
date: Wed Jul 6 06:04:43 EDT 2022
Check for gamepad axis select on quit and reset
--- a/input.c
+++ b/input.c
@@ -365,13 +365,14 @@
// Read special case game controller buttons quit and reset
for (int gc = 0; gc < num_joysticks; gc++) {- if (SDL_GameControllerGetButton(game_controllers[gc], conf->gamepad_quit) &&
- SDL_GameControllerGetButton(game_controllers[gc], conf->gamepad_select)) {- key = (input_msg_s){special, msg_quit};- } else if (SDL_GameControllerGetButton(game_controllers[gc], conf->gamepad_reset) &&
- SDL_GameControllerGetButton(game_controllers[gc], conf->gamepad_select)) {- key = (input_msg_s){special, msg_reset_display};- }
+ if (SDL_GameControllerGetButton(game_controllers[gc], conf->gamepad_quit) &&
+ (SDL_GameControllerGetButton(game_controllers[gc], conf->gamepad_select) ||
+ SDL_GameControllerGetAxis(game_controllers[gc], conf->gamepad_analog_axis_select)))
+ key = (input_msg_s){special, msg_quit};+ else if (SDL_GameControllerGetButton(game_controllers[gc], conf->gamepad_reset) &&
+ (SDL_GameControllerGetButton(game_controllers[gc], conf->gamepad_select) ||
+ SDL_GameControllerGetAxis(game_controllers[gc], conf->gamepad_analog_axis_select)))
+ key = (input_msg_s){special, msg_reset_display};}
SDL_PollEvent(&event);
--
⑨