From 0eb24da2e78b68d174ec7e51d1058f2ae6762f91 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Thu, 16 Apr 2020 19:41:55 +0400 Subject: [PATCH] Fix controls disabling --- apps/openmw/mwinput/inputmanagerimp.cpp | 3 +-- apps/openmw/mwinput/keyboardmanager.cpp | 5 ----- apps/openmw/mwinput/keyboardmanager.hpp | 4 ++-- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index b9b9ecf62..f7f32b9a9 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -216,9 +216,9 @@ namespace MWInput void InputManager::update(float dt, bool disableControls, bool disableEvents) { mInputWrapper->setMouseVisible(MWBase::Environment::get().getWindowManager()->getCursorVisible()); - mInputWrapper->capture(disableEvents); + mKeyboardManager->setControlsDisabled(disableControls); if (disableControls) { updateCursorMode(); @@ -231,7 +231,6 @@ namespace MWInput updateCursorMode(); bool controllerMove = mControllerManager->update(dt, disableControls); - mKeyboardManager->update(dt, disableControls); mMouseManager->update(dt, disableControls); mSensorManager->update(dt, mGuiCursorEnabled); mActionManager->update(dt, controllerMove); diff --git a/apps/openmw/mwinput/keyboardmanager.cpp b/apps/openmw/mwinput/keyboardmanager.cpp index 9cca00441..773ea4028 100644 --- a/apps/openmw/mwinput/keyboardmanager.cpp +++ b/apps/openmw/mwinput/keyboardmanager.cpp @@ -27,11 +27,6 @@ namespace MWInput { } - void KeyboardManager::update(float dt, bool disableControls) - { - mControlsDisabled = disableControls; - } - bool KeyboardManager::actionIsActive (int id) { return (mInputBinder->getChannel(id)->getValue ()==1.0); diff --git a/apps/openmw/mwinput/keyboardmanager.hpp b/apps/openmw/mwinput/keyboardmanager.hpp index 55b91bac4..9d1c0b4fd 100644 --- a/apps/openmw/mwinput/keyboardmanager.hpp +++ b/apps/openmw/mwinput/keyboardmanager.hpp @@ -25,12 +25,12 @@ namespace MWInput virtual ~KeyboardManager() = default; - void update(float dt, bool disableControls); - virtual void textInput(const SDL_TextInputEvent &arg); virtual void keyPressed(const SDL_KeyboardEvent &arg); virtual void keyReleased(const SDL_KeyboardEvent &arg); + void setControlsDisabled(bool disabled) { mControlsDisabled = disabled; } + private: bool actionIsActive(int id);