From 658036b40261a87b86c0677f224652eff5377ce2 Mon Sep 17 00:00:00 2001 From: mbudd02 Date: Mon, 28 Feb 2022 20:36:09 -0500 Subject: [PATCH] Bug fix for Qt GUI mac OSX command and control key mappings. --- src/drivers/Qt/keyscan.cpp | 42 +++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/src/drivers/Qt/keyscan.cpp b/src/drivers/Qt/keyscan.cpp index 5aa598f3..bc83789d 100644 --- a/src/drivers/Qt/keyscan.cpp +++ b/src/drivers/Qt/keyscan.cpp @@ -665,16 +665,7 @@ SDL_Keycode convQtKey2SDLKeyCode(Qt::Key q, uint32_t nativeVirtualKey) } break; case Key_Control: - if ( nativeVirtualKey == CtrlKeyCodeR ) - { - s = SDLK_RCTRL; - } - else - { - s = SDLK_LCTRL; - } - break; - case Key_Meta: + #ifdef __APPLE__ if ( nativeVirtualKey == MetaKeyCodeR ) { s = SDLK_RGUI; @@ -683,6 +674,37 @@ SDL_Keycode convQtKey2SDLKeyCode(Qt::Key q, uint32_t nativeVirtualKey) { s = SDLK_LGUI; } + #else + if ( nativeVirtualKey == CtrlKeyCodeR ) + { + s = SDLK_RCTRL; + } + else + { + s = SDLK_LCTRL; + } + #endif + break; + case Key_Meta: + #ifdef __APPLE__ + if ( nativeVirtualKey == CtrlKeyCodeR ) + { + s = SDLK_RCTRL; + } + else + { + s = SDLK_LCTRL; + } + #else + if ( nativeVirtualKey == MetaKeyCodeR ) + { + s = SDLK_RGUI; + } + else + { + s = SDLK_LGUI; + } + #endif break; case Key_Alt: if ( nativeVirtualKey == AltKeyCodeR )