From d619d0fa2557b9fa4a4d1aeb8ee26262aa7c7efa Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 15 Nov 2013 03:39:25 +0100 Subject: [PATCH] Don't grab the cursor while the console is opened --- apps/openmw/mwinput/inputmanagerimp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index f9ea3dfc3e..35487e3391 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -274,7 +274,8 @@ namespace MWInput if (!loading) mInputBinder->update(dt); - bool main_menu = MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_MainMenu); + bool grab = !MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_MainMenu) + && MWBase::Environment::get().getWindowManager()->getMode() != MWGui::GM_Console; bool was_relative = mInputManager->getMouseRelative(); bool is_relative = !MWBase::Environment::get().getWindowManager()->isGuiMode(); @@ -284,7 +285,7 @@ namespace MWInput mInputManager->setMouseRelative(is_relative); //we let the mouse escape in the main menu - mInputManager->setGrabPointer(!main_menu); + mInputManager->setGrabPointer(grab); //we switched to non-relative mode, move our cursor to where the in-game //cursor is