diff options
author | Simon Howard | 2014-04-29 01:09:07 -0400 |
---|---|---|
committer | Simon Howard | 2014-04-29 01:09:07 -0400 |
commit | db9aee2bebf410ed9e4d44b1fae35a27de40289f (patch) | |
tree | 398c5bc920339260c30ad4572c5eb0bfddce71bc /src/setup/txt_joybinput.c | |
parent | 3a0370f2762c1927d7819377e798393e5d55ddd8 (diff) | |
download | chocolate-doom-db9aee2bebf410ed9e4d44b1fae35a27de40289f.tar.gz chocolate-doom-db9aee2bebf410ed9e4d44b1fae35a27de40289f.tar.bz2 chocolate-doom-db9aee2bebf410ed9e4d44b1fae35a27de40289f.zip |
setup: Allow backspace or del to clear controls.
Backspace or delete clears other input boxes; make it do the same for
keyboard, mouse and joystick inputs.
Diffstat (limited to 'src/setup/txt_joybinput.c')
-rw-r--r-- | src/setup/txt_joybinput.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/setup/txt_joybinput.c b/src/setup/txt_joybinput.c index 4e41f3fd..f431690b 100644 --- a/src/setup/txt_joybinput.c +++ b/src/setup/txt_joybinput.c @@ -161,11 +161,11 @@ static void TXT_JoystickInputDestructor(TXT_UNCAST_ARG(joystick_input)) { } -static int TXT_JoystickInputKeyPress(TXT_UNCAST_ARG(joystick_input), int joystick) +static int TXT_JoystickInputKeyPress(TXT_UNCAST_ARG(joystick_input), int key) { TXT_CAST_ARG(txt_joystick_input_t, joystick_input); - if (joystick == KEY_ENTER) + if (key == KEY_ENTER) { // Open a window to prompt for the new joystick press @@ -174,6 +174,11 @@ static int TXT_JoystickInputKeyPress(TXT_UNCAST_ARG(joystick_input), int joystic return 1; } + if (key == KEY_BACKSPACE || key == KEY_DEL) + { + *joystick_input->variable = -1; + } + return 0; } |