summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2009-06-12 17:34:27 +0000
committerSimon Howard2009-06-12 17:34:27 +0000
commitc80600ef2c0ded9c51ebd0f169972149956d939b (patch)
treeda383e569ae62cb71a20b94b0a26124475dcc456
parent43748a366a4bc5494c15995273bfe158530e03de (diff)
downloadchocolate-doom-c80600ef2c0ded9c51ebd0f169972149956d939b.tar.gz
chocolate-doom-c80600ef2c0ded9c51ebd0f169972149956d939b.tar.bz2
chocolate-doom-c80600ef2c0ded9c51ebd0f169972149956d939b.zip
Always grab input on Windows CE.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1597
-rw-r--r--src/i_video.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/i_video.c b/src/i_video.c
index e0db6145..aaefd922 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -182,7 +182,7 @@ static boolean MouseShouldBeGrabbed()
if (screensaver_mode)
return false;
- // if the window doesnt have focus, never grab it
+ // if the window doesn't have focus, never grab it
if (!window_focused)
return false;
@@ -193,6 +193,17 @@ static boolean MouseShouldBeGrabbed()
if (fullscreen)
return true;
+#ifdef _WIN32_WCE
+
+ // On Windows CE, always grab input. This is because hardware
+ // button events are only acquired by SDL when the input is grabbed.
+ // Almost all Windows CE devices should have touch screens anyway,
+ // so this shouldn't affect mouse grabbing behavior.
+
+ return true;
+
+#else
+
// Don't grab the mouse if mouse input is disabled
if (!usemouse || nomouse)
@@ -204,18 +215,20 @@ static boolean MouseShouldBeGrabbed()
return false;
// if we specify not to grab the mouse, never grab
-
+
if (!grabmouse)
return false;
// when menu is active or game is paused, release the mouse
-
+
if (menuactive || paused)
return false;
// only grab mouse when playing levels (but not demos)
return (gamestate == GS_LEVEL) && !demoplayback;
+
+#endif /* #ifndef _WIN32_WCE */
}
// Update the value of window_focused when we get a focus event