summaryrefslogtreecommitdiff
path: root/setup/txt_joybinput.c
diff options
context:
space:
mode:
authorSimon Howard2011-04-11 19:49:45 +0000
committerSimon Howard2011-04-11 19:49:45 +0000
commiteb86fcdf3099404ed8cc0feaf96dd94654d2b8dd (patch)
tree26acfbe82ee8ce3281e8f254467e6f66af095159 /setup/txt_joybinput.c
parentd4ef7c37721ee261ac23305fd52239a91e58250a (diff)
downloadchocolate-doom-eb86fcdf3099404ed8cc0feaf96dd94654d2b8dd.tar.gz
chocolate-doom-eb86fcdf3099404ed8cc0feaf96dd94654d2b8dd.tar.bz2
chocolate-doom-eb86fcdf3099404ed8cc0feaf96dd94654d2b8dd.zip
Allow the shift key to be held down when changing key/mouse/joystick
bindings to prevent bindings to the same key from being cleared (thanks myk). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2325
Diffstat (limited to 'setup/txt_joybinput.c')
-rw-r--r--setup/txt_joybinput.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/setup/txt_joybinput.c b/setup/txt_joybinput.c
index 861414f7..9ad26a45 100644
--- a/setup/txt_joybinput.c
+++ b/setup/txt_joybinput.c
@@ -48,7 +48,12 @@ static int EventCallback(SDL_Event *event, TXT_UNCAST_ARG(joystick_input))
if (event->type == SDL_JOYBUTTONDOWN)
{
*joystick_input->variable = event->jbutton.button;
- TXT_EmitSignal(joystick_input, "set");
+
+ if (joystick_input->check_conflicts)
+ {
+ TXT_EmitSignal(joystick_input, "set");
+ }
+
TXT_CloseWindow(joystick_input->prompt_window);
return 1;
}
@@ -89,6 +94,10 @@ static void OpenPromptWindow(txt_joystick_input_t *joystick_input)
txt_label_t *label;
SDL_Joystick *joystick;
+ // Silently update when the shift button is held down.
+
+ joystick_input->check_conflicts = !TXT_GetModifierState(TXT_MOD_SHIFT);
+
if (SDL_Init(SDL_INIT_JOYSTICK) < 0)
{
return;