ref: 2429cad1044d5c68f78e74e04d2eaa01efc3e37f
parent: 99fecdb9392be2cc7d9a8b55ce500e524f88aa5f
parent: a1f5c6ff94245e99a49042f564d3f28ec436282a
author: Jonne Kokkonen <jonne.kokkonen@gmail.com>
date: Wed Jul 6 16:32:39 EDT 2022
Merge pull request #84 from smootalicious/main 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);
--
⑨