1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-19 19:53:53 +00:00

Merge pull request #2768 from glassmancody/tabfix

Fix tab focus for pinned windows
This commit is contained in:
Alexei Dobrohotov 2020-04-18 22:27:51 +03:00 committed by GitHub
commit b5ff32569b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -116,6 +116,12 @@ void KeyboardNavigation::onFrame()
if (!mEnabled) if (!mEnabled)
return; return;
if (!MWBase::Environment::get().getWindowManager()->isGuiMode())
{
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(nullptr);
return;
}
MyGUI::Widget* focus = MyGUI::InputManager::getInstance().getKeyFocusWidget(); MyGUI::Widget* focus = MyGUI::InputManager::getInstance().getKeyFocusWidget();
if (focus == mCurrentFocus) if (focus == mCurrentFocus)
@ -215,6 +221,9 @@ bool KeyboardNavigation::injectKeyPress(MyGUI::KeyCode key, unsigned int text, b
bool KeyboardNavigation::switchFocus(int direction, bool wrap) bool KeyboardNavigation::switchFocus(int direction, bool wrap)
{ {
if (!MWBase::Environment::get().getWindowManager()->isGuiMode())
return false;
MyGUI::Widget* focus = MyGUI::InputManager::getInstance().getKeyFocusWidget(); MyGUI::Widget* focus = MyGUI::InputManager::getInstance().getKeyFocusWidget();
bool isCycle = (direction == D_Prev || direction == D_Next); bool isCycle = (direction == D_Prev || direction == D_Next);