diff --git a/application.cpp b/application.cpp index 4106fa07..40082da1 100644 --- a/application.cpp +++ b/application.cpp @@ -681,6 +681,13 @@ eu07_application::on_key( int const Key, int const Scancode, int const Action, i if( m_modestack.empty() ) { return; } + if (Key == GLFW_KEY_LEFT_SHIFT || Key == GLFW_KEY_RIGHT_SHIFT) + Global.shiftState = Action == GLFW_PRESS; + if (Key == GLFW_KEY_LEFT_CONTROL || Key == GLFW_KEY_RIGHT_CONTROL) + Global.ctrlState = Action == GLFW_PRESS; + if (Key == GLFW_KEY_LEFT_ALT || Key == GLFW_KEY_RIGHT_ALT) + Global.altState = Action == GLFW_PRESS; + m_modes[ m_modestack.top() ]->on_key( Key, Scancode, Action, Mods ); } diff --git a/drivermode.cpp b/drivermode.cpp index d8f5dc58..3e780bc9 100644 --- a/drivermode.cpp +++ b/drivermode.cpp @@ -431,10 +431,6 @@ driver_mode::exit() { void driver_mode::on_key( int const Key, int const Scancode, int const Action, int const Mods ) { - Global.shiftState = ( Mods & GLFW_MOD_SHIFT ) ? true : false; - Global.ctrlState = ( Mods & GLFW_MOD_CONTROL ) ? true : false; - Global.altState = ( Mods & GLFW_MOD_ALT ) ? true : false; - bool anyModifier = Mods & (GLFW_MOD_SHIFT | GLFW_MOD_CONTROL | GLFW_MOD_ALT); // give the ui first shot at the input processing... diff --git a/editormode.cpp b/editormode.cpp index f2cd69bc..c743957c 100644 --- a/editormode.cpp +++ b/editormode.cpp @@ -155,10 +155,6 @@ editor_mode::exit() { void editor_mode::on_key( int const Key, int const Scancode, int const Action, int const Mods ) { - Global.shiftState = ( Mods & GLFW_MOD_SHIFT ) ? true : false; - Global.ctrlState = ( Mods & GLFW_MOD_CONTROL ) ? true : false; - Global.altState = ( Mods & GLFW_MOD_ALT ) ? true : false; - bool anyModifier = Mods & (GLFW_MOD_SHIFT | GLFW_MOD_CONTROL | GLFW_MOD_ALT); // give the ui first shot at the input processing... diff --git a/launcher/launchermode.cpp b/launcher/launchermode.cpp index 1d9f5a79..7ef21ab2 100644 --- a/launcher/launchermode.cpp +++ b/launcher/launchermode.cpp @@ -36,7 +36,5 @@ void launcher_mode::exit() void launcher_mode::on_key(const int Key, const int Scancode, const int Action, const int Mods) { - Global.shiftState = ( Mods & GLFW_MOD_SHIFT ) ? true : false; - Global.ctrlState = ( Mods & GLFW_MOD_CONTROL ) ? true : false; m_userinterface->on_key(Key, Action); }