From 8a3e9c35142c115188b03aa4d73117a8f12e3175 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 17 Nov 2013 19:32:07 +0100 Subject: Try to implement darwin modifier keys --- qxt-mini/qxtglobalshortcut_p.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/qxt-mini/qxtglobalshortcut_p.h b/qxt-mini/qxtglobalshortcut_p.h index e3f3ddd3..5b10d089 100644 --- a/qxt-mini/qxtglobalshortcut_p.h +++ b/qxt-mini/qxtglobalshortcut_p.h @@ -75,11 +75,19 @@ public: EventRef Event = reinterpret_cast(message); UInt32 EventClass = GetEventClass (Event); UInt32 EventKind = GetEventKind (Event); + UInt32 eventModifiers = 0; + GetEventParameter(Event, + kEventParamKeyModifiers, + typeUInt32, + NULL, + sizeof(UInt32), + NULL, + &eventModifiers); if (kEventClassKeyboard && EventKind == kEventRawKeyDown) { - UInt32 keyPressed; + UInt32 keyPressed = -1; GetEventParameter(Event, kEventParamKeyCode, typeUInt32, NULL, sizeof(UInt32), NULL, &keyPressed); - return keyPressed == nativeKeycode(key); + return keyPressed == nativeKeycode(key) && nativeModifiers(mods) == eventModifiers; } } #endif // Q_WS_MAC -- cgit v1.2.3