From c5a4f04bc21825a0bdd59bef804229389a7a4ce1 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Fri, 9 Mar 2007 12:35:18 +0000 Subject: Fix discrepancy between Doom and setup program when prompting for keys. Add the ability to enable/disable key mappings so that the raw key can be read in setup, exactly the same way that it is in Doom. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 846 --- setup/txt_keyinput.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'setup') diff --git a/setup/txt_keyinput.c b/setup/txt_keyinput.c index bdf2f926..b7e68f44 100644 --- a/setup/txt_keyinput.c +++ b/setup/txt_keyinput.c @@ -44,6 +44,11 @@ static int KeyPressCallback(txt_window_t *window, int key, *key_input->variable = key; TXT_EmitSignal(key_input, "set"); TXT_CloseWindow(window); + + // Re-enable key mappings now that we have the key + + TXT_EnableKeyMapping(1); + return 1; } else @@ -69,6 +74,10 @@ static void OpenPromptWindow(txt_key_input_t *key_input) TXT_SetWidgetAlign(label, TXT_HORIZ_CENTER); TXT_SetKeyListener(window, KeyPressCallback, key_input); + + // Disable key mappings while we prompt for the key press + + TXT_EnableKeyMapping(0); } static void TXT_KeyInputSizeCalc(TXT_UNCAST_ARG(key_input)) -- cgit v1.2.3