diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/i_video.c | 19 |
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 |