diff options
-rw-r--r-- | src/frontend/qt_sdl/Input.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/frontend/qt_sdl/Input.cpp b/src/frontend/qt_sdl/Input.cpp index ed014b7..f3ad651 100644 --- a/src/frontend/qt_sdl/Input.cpp +++ b/src/frontend/qt_sdl/Input.cpp @@ -226,7 +226,6 @@ bool HotkeyPressed(int id) { return HotkeyPress & (1<<id); } bool HotkeyReleased(int id) { return HotkeyRelease & (1<<id); } -// TODO: MacOS version of this! // distinguish between left and right modifier keys (Ctrl, Alt, Shift) // Qt provides no real cross-platform way to do this, so here we go // for Windows and Linux we can distinguish via scancodes (but both @@ -237,6 +236,12 @@ bool IsRightModKey(QKeyEvent* event) quint32 scan = event->nativeScanCode(); return (scan == 0x11D || scan == 0x138 || scan == 0x36); } +#elifdef __APPLE__ +bool IsRightModKey(QKeyEvent* event) +{ + quint32 scan = event->nativeVirtualKey(); + return (scan == 0x37 || scan == 0x3A || scan == 0x3C || scan == 0x3E); +} #else bool IsRightModKey(QKeyEvent* event) { |