diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index 10b850541..44a508e89 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -21,6 +21,7 @@ */ #include "../mwmp/Main.hpp" #include "../mwmp/LocalPlayer.hpp" +#include "../mwmp/GUIController.hpp" /* End of tes3mp addition */ @@ -863,7 +864,16 @@ namespace MWInput void InputManager::keyPressed( const SDL_KeyboardEvent &arg ) { - mwmp::Main::pressedKey(arg.keysym.scancode); + /* + Start of tes3mp addition + + Pass the pressed key to the multiplayer-specific GUI controller + */ + mwmp::Main::get().getGUIController()->pressedKey(arg.keysym.scancode); + /* + End of tes3mp addition + */ + // HACK: to make Morrowind's default keybinding for the console work without printing an extra "^" upon closing // This assumes that SDL_TextInput events always come *after* the key event // (which is somewhat reasonable, and hopefully true for all SDL platforms) diff --git a/apps/openmw/mwmp/Main.cpp b/apps/openmw/mwmp/Main.cpp index 2bd6bb3c0..90b9e0685 100644 --- a/apps/openmw/mwmp/Main.cpp +++ b/apps/openmw/mwmp/Main.cpp @@ -257,13 +257,6 @@ CellController *Main::getCellController() const return mCellController; } -void Main::pressedKey(int key) -{ - if (pMain == nullptr) return; - if (get().getGUIController()->pressedKey(key)) - return; // if any gui bind pressed -} - // When sending packets with ingame script values, certain packets // should be ignored because of their potential for spam bool Main::isValidPacketScript(std::string script) diff --git a/apps/openmw/mwmp/Main.hpp b/apps/openmw/mwmp/Main.hpp index a9ba70850..18522d149 100644 --- a/apps/openmw/mwmp/Main.hpp +++ b/apps/openmw/mwmp/Main.hpp @@ -25,7 +25,6 @@ namespace mwmp static void destroy(); static const Main &get(); static void frame(float dt); - static void pressedKey(int key); static bool isValidPacketScript(std::string script); static std::string getResDir();