mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Fix shift, ctrl and alt key handling on windows
This commit is contained in:
@@ -1473,6 +1473,7 @@ global_settings::export_as_text( std::ostream &Output ) const {
|
|||||||
export_as_text( Output, "python.threadedupload", python_threadedupload );
|
export_as_text( Output, "python.threadedupload", python_threadedupload );
|
||||||
export_as_text( Output, "python.uploadmain", python_uploadmain );
|
export_as_text( Output, "python.uploadmain", python_uploadmain );
|
||||||
export_as_text( Output, "python.mipmaps", python_mipmaps );
|
export_as_text( Output, "python.mipmaps", python_mipmaps );
|
||||||
|
export_as_text( Output, "async.trainThreads", trainThreads );
|
||||||
for( auto const &server : network_servers ) {
|
for( auto const &server : network_servers ) {
|
||||||
Output
|
Output
|
||||||
<< "network.server "
|
<< "network.server "
|
||||||
|
|||||||
@@ -741,12 +741,14 @@ eu07_application::on_key( int const Key, int const Scancode, int const Action, i
|
|||||||
|
|
||||||
if( m_modestack.empty() ) { return; }
|
if( m_modestack.empty() ) { return; }
|
||||||
|
|
||||||
|
#ifdef __unix__
|
||||||
if (Key == GLFW_KEY_LEFT_SHIFT || Key == GLFW_KEY_RIGHT_SHIFT)
|
if (Key == GLFW_KEY_LEFT_SHIFT || Key == GLFW_KEY_RIGHT_SHIFT)
|
||||||
Global.shiftState = Action == GLFW_PRESS;
|
Global.shiftState = Action == GLFW_PRESS;
|
||||||
if (Key == GLFW_KEY_LEFT_CONTROL || Key == GLFW_KEY_RIGHT_CONTROL)
|
if (Key == GLFW_KEY_LEFT_CONTROL || Key == GLFW_KEY_RIGHT_CONTROL)
|
||||||
Global.ctrlState = Action == GLFW_PRESS;
|
Global.ctrlState = Action == GLFW_PRESS;
|
||||||
if (Key == GLFW_KEY_LEFT_ALT || Key == GLFW_KEY_RIGHT_ALT)
|
if (Key == GLFW_KEY_LEFT_ALT || Key == GLFW_KEY_RIGHT_ALT)
|
||||||
Global.altState = Action == GLFW_PRESS;
|
Global.altState = Action == GLFW_PRESS;
|
||||||
|
#endif
|
||||||
|
|
||||||
m_modes[ m_modestack.top() ]->on_key( Key, Scancode, Action, Mods );
|
m_modes[ m_modestack.top() ]->on_key( Key, Scancode, Action, Mods );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -432,6 +432,12 @@ driver_mode::exit() {
|
|||||||
void
|
void
|
||||||
driver_mode::on_key( int const Key, int const Scancode, int const Action, int const Mods ) {
|
driver_mode::on_key( int const Key, int const Scancode, int const Action, int const Mods ) {
|
||||||
|
|
||||||
|
#ifndef __unix__
|
||||||
|
Global.shiftState = (Mods & GLFW_MOD_SHIFT) ? true : false;
|
||||||
|
Global.ctrlState = (Mods & GLFW_MOD_CONTROL) ? true : false;
|
||||||
|
Global.altState = (Mods & GLFW_MOD_ALT) ? true : false;
|
||||||
|
#endif
|
||||||
|
|
||||||
bool anyModifier = Mods & (GLFW_MOD_SHIFT | GLFW_MOD_CONTROL | GLFW_MOD_ALT);
|
bool anyModifier = Mods & (GLFW_MOD_SHIFT | GLFW_MOD_CONTROL | GLFW_MOD_ALT);
|
||||||
|
|
||||||
// give the ui first shot at the input processing...
|
// give the ui first shot at the input processing...
|
||||||
|
|||||||
@@ -154,7 +154,11 @@ editor_mode::exit() {
|
|||||||
|
|
||||||
void
|
void
|
||||||
editor_mode::on_key( int const Key, int const Scancode, int const Action, int const Mods ) {
|
editor_mode::on_key( int const Key, int const Scancode, int const Action, int const Mods ) {
|
||||||
|
#ifndef __unix__
|
||||||
|
Global.shiftState = (Mods & GLFW_MOD_SHIFT) ? true : false;
|
||||||
|
Global.ctrlState = (Mods & GLFW_MOD_CONTROL) ? true : false;
|
||||||
|
Global.altState = (Mods & GLFW_MOD_ALT) ? true : false;
|
||||||
|
#endif
|
||||||
bool anyModifier = Mods & (GLFW_MOD_SHIFT | GLFW_MOD_CONTROL | GLFW_MOD_ALT);
|
bool anyModifier = Mods & (GLFW_MOD_SHIFT | GLFW_MOD_CONTROL | GLFW_MOD_ALT);
|
||||||
|
|
||||||
// give the ui first shot at the input processing...
|
// give the ui first shot at the input processing...
|
||||||
|
|||||||
@@ -34,6 +34,11 @@ void launcher_mode::exit()
|
|||||||
|
|
||||||
void launcher_mode::on_key(const int Key, const int Scancode, const int Action, const int Mods)
|
void launcher_mode::on_key(const int Key, const int Scancode, const int Action, const int Mods)
|
||||||
{
|
{
|
||||||
|
#ifndef __unix__
|
||||||
|
Global.shiftState = (Mods & GLFW_MOD_SHIFT) ? true : false;
|
||||||
|
Global.ctrlState = (Mods & GLFW_MOD_CONTROL) ? true : false;
|
||||||
|
Global.altState = (Mods & GLFW_MOD_ALT) ? true : false;
|
||||||
|
#endif
|
||||||
m_userinterface->on_key(Key, Action);
|
m_userinterface->on_key(Key, Action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user