1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
Author: Andres Mejia <mcitadel@gmail.com>
Description: Support disabling of keyboard and mouse capture for debugging.
Forwarded: http://funguloids.sourceforge.net/disable_mouse_capture.patch
--- a/src/input.cpp
+++ b/src/input.cpp
@@ -37,6 +37,21 @@
OIS::ParamList pl;
pl.insert(OIS::ParamList::value_type("WINDOW", Ogre::StringConverter::toString(hWnd)));
+ // Disable mouse capture for debugging.
+ #ifdef DISABLE_MOUSE_CAPTURE
+ #if defined OIS_WIN32_PLATFORM
+ pl.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_FOREGROUND" )));
+ pl.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_NONEXCLUSIVE")));
+ pl.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_FOREGROUND")));
+ pl.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_NONEXCLUSIVE")));
+ #elif defined OIS_LINUX_PLATFORM
+ pl.insert(std::make_pair(std::string("x11_mouse_grab"), std::string("false")));
+ pl.insert(std::make_pair(std::string("x11_mouse_hide"), std::string("false")));
+ pl.insert(std::make_pair(std::string("x11_keyboard_grab"), std::string("false")));
+ pl.insert(std::make_pair(std::string("XAutoRepeatOn"), std::string("true")));
+ #endif
+ #endif
+
mHWnd = hWnd;
mInputManager = OIS::InputManager::createInputSystem(pl);
mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject(OIS::OISMouse, true));
|