summaryrefslogtreecommitdiff
path: root/src/setup/txt_keyinput.c
diff options
context:
space:
mode:
authorSimon Howard2009-06-12 00:23:33 +0000
committerSimon Howard2009-06-12 00:23:33 +0000
commit0f5de61b743fdf05335436c1c71b4b488870483f (patch)
tree43eca2de9916341a75148e681e73fff20299d9e8 /src/setup/txt_keyinput.c
parentec03448333ca4c1d996dcb2b9c9ac01522a271bd (diff)
parent43748a366a4bc5494c15995273bfe158530e03de (diff)
downloadchocolate-doom-0f5de61b743fdf05335436c1c71b4b488870483f.tar.gz
chocolate-doom-0f5de61b743fdf05335436c1c71b4b488870483f.tar.bz2
chocolate-doom-0f5de61b743fdf05335436c1c71b4b488870483f.zip
Merge from trunk.
Subversion-branch: /branches/raven-branch Subversion-revision: 1596
Diffstat (limited to 'src/setup/txt_keyinput.c')
-rw-r--r--src/setup/txt_keyinput.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/setup/txt_keyinput.c b/src/setup/txt_keyinput.c
index b7e68f44..e385cc59 100644
--- a/src/setup/txt_keyinput.c
+++ b/src/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))