From c97a36ae2b8038505d5103df1b7e6154498212d3 Mon Sep 17 00:00:00 2001 From: mjbudd77 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 )