From eb86fcdf3099404ed8cc0feaf96dd94654d2b8dd Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 11 Apr 2011 19:49:45 +0000 Subject: 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 --- setup/txt_joybinput.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'setup/txt_joybinput.c') 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; -- cgit v1.2.3