foxygit / doom Log in
commit c80600ef2c0ded9c51ebd0f169972149956d939b
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Fri Jun 12 17:34:27 2009 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Fri Jun 12 17:34:27 2009 +0000

    Always grab input on Windows CE.

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 1597
---
 src/i_video.c | 19 ++++++++++++++++---
 1 file 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