Bug fix for Qt GUI mac OSX command and control key mappings.

This commit is contained in:
mbudd02 2022-02-28 20:36:09 -05:00
parent 4d6d060757
commit 658036b402
1 changed files with 32 additions and 10 deletions

View File

@ -665,16 +665,7 @@ SDL_Keycode convQtKey2SDLKeyCode(Qt::Key q, uint32_t nativeVirtualKey)
} }
break; break;
case Key_Control: case Key_Control:
if ( nativeVirtualKey == CtrlKeyCodeR ) #ifdef __APPLE__
{
s = SDLK_RCTRL;
}
else
{
s = SDLK_LCTRL;
}
break;
case Key_Meta:
if ( nativeVirtualKey == MetaKeyCodeR ) if ( nativeVirtualKey == MetaKeyCodeR )
{ {
s = SDLK_RGUI; s = SDLK_RGUI;
@ -683,6 +674,37 @@ SDL_Keycode convQtKey2SDLKeyCode(Qt::Key q, uint32_t nativeVirtualKey)
{ {
s = SDLK_LGUI; 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; break;
case Key_Alt: case Key_Alt:
if ( nativeVirtualKey == AltKeyCodeR ) if ( nativeVirtualKey == AltKeyCodeR )