diff options
author | Simon Howard | 2009-06-11 19:41:20 +0000 |
---|---|---|
committer | Simon Howard | 2009-06-11 19:41:20 +0000 |
commit | 779a2157c0e5afe358b03c8236e88a661b35bca0 (patch) | |
tree | 8c35ab56b1540b2bf2d6c2e8ba76b5c77a30c4fb /setup | |
parent | 3a4db2509420fa89c2ee940cc0998d0d614d63a5 (diff) | |
download | chocolate-doom-779a2157c0e5afe358b03c8236e88a661b35bca0.tar.gz chocolate-doom-779a2157c0e5afe358b03c8236e88a661b35bca0.tar.bz2 chocolate-doom-779a2157c0e5afe358b03c8236e88a661b35bca0.zip |
Grab the input in setup when reading a new key binding, so that Windows
CE buttons are read properly. Map buttons to PC function keys.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1594
Diffstat (limited to 'setup')
-rw-r--r-- | setup/txt_keyinput.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/setup/txt_keyinput.c b/setup/txt_keyinput.c index b7e68f44..e385cc59 100644 --- a/setup/txt_keyinput.c +++ b/setup/txt_keyinput.c @@ -57,6 +57,11 @@ static int KeyPressCallback(txt_window_t *window, int key, } } +static void ReleaseGrab(TXT_UNCAST_ARG(window), TXT_UNCAST_ARG(unused)) +{ + SDL_WM_GrabInput(SDL_GRAB_OFF); +} + static void OpenPromptWindow(txt_key_input_t *key_input) { txt_window_t *window; @@ -78,6 +83,13 @@ static void OpenPromptWindow(txt_key_input_t *key_input) // Disable key mappings while we prompt for the key press TXT_EnableKeyMapping(0); + + // Grab input while reading the key. On Windows Mobile + // handheld devices, the hardware keypresses are only + // detected when input is grabbed. + + SDL_WM_GrabInput(SDL_GRAB_ON); + TXT_SignalConnect(window, "closed", ReleaseGrab, NULL); } static void TXT_KeyInputSizeCalc(TXT_UNCAST_ARG(key_input)) |