From fb02ba174d10a3cb63ed9e1f5b0ad625713efab1 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Thu, 5 Dec 2024 17:23:58 +0100 Subject: [PATCH] Remove period and slash from keyboard navigation and inject tabs when using a controller --- apps/openmw/mwgui/keyboardnavigation.cpp | 4 ---- apps/openmw/mwinput/controllermanager.cpp | 6 ++++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/openmw/mwgui/keyboardnavigation.cpp b/apps/openmw/mwgui/keyboardnavigation.cpp index 9d4971951a..c6d006eefd 100644 --- a/apps/openmw/mwgui/keyboardnavigation.cpp +++ b/apps/openmw/mwgui/keyboardnavigation.cpp @@ -183,10 +183,6 @@ namespace MWGui return switchFocus(D_Down, false); case MyGUI::KeyCode::Tab: return switchFocus(MyGUI::InputManager::getInstance().isShiftPressed() ? D_Prev : D_Next, true); - case MyGUI::KeyCode::Period: - return switchFocus(D_Prev, true); - case MyGUI::KeyCode::Slash: - return switchFocus(D_Next, true); case MyGUI::KeyCode::Return: case MyGUI::KeyCode::NumpadEnter: case MyGUI::KeyCode::Space: diff --git a/apps/openmw/mwinput/controllermanager.cpp b/apps/openmw/mwinput/controllermanager.cpp index 0c0a3de57c..1a8490d8b7 100644 --- a/apps/openmw/mwinput/controllermanager.cpp +++ b/apps/openmw/mwinput/controllermanager.cpp @@ -277,10 +277,12 @@ namespace MWInput key = MyGUI::KeyCode::Apostrophe; break; case SDL_CONTROLLER_BUTTON_LEFTSHOULDER: - MWBase::Environment::get().getWindowManager()->injectKeyPress(MyGUI::KeyCode::Period, 0, false); + MyGUI::InputManager::getInstance().injectKeyPress(MyGUI::KeyCode::LeftShift); + MWBase::Environment::get().getWindowManager()->injectKeyPress(MyGUI::KeyCode::Tab, 0, false); + MyGUI::InputManager::getInstance().injectKeyRelease(MyGUI::KeyCode::LeftShift); return true; case SDL_CONTROLLER_BUTTON_RIGHTSHOULDER: - MWBase::Environment::get().getWindowManager()->injectKeyPress(MyGUI::KeyCode::Slash, 0, false); + MWBase::Environment::get().getWindowManager()->injectKeyPress(MyGUI::KeyCode::Tab, 0, false); return true; case SDL_CONTROLLER_BUTTON_LEFTSTICK: mGamepadGuiCursorEnabled = !mGamepadGuiCursorEnabled;