From a5c6329829ba8565fb3fe5fd546e9d5f1a8fb71d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Sun, 28 Jun 2020 16:13:52 +0200 Subject: [PATCH] Pass correct modifier to QCocoaKeyMapper::toKeyCode() The modifierKeyState variable is based on the Carbon modifiers, and then further mangled to match the expected format of UCKeyTranslate. But inside QCocoaKeyMapper::toKeyCode() we compare the modifiers to Qt::KeyboardModifiers. To ensure the logic works as expected we need to pass in the Qt modifiers. This fixes shortcut sequences based on "Backtab". Change-Id: I089fe601f0fe7a92f746e0a6447e2de0d974d0b2 Reviewed-by: Timur Pocheptsov --- src/plugins/platforms/cocoa/qcocoakeymapper.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoakeymapper.mm b/src/plugins/platforms/cocoa/qcocoakeymapper.mm index c326c1ca84..86143f275b 100644 --- a/src/plugins/platforms/cocoa/qcocoakeymapper.mm +++ b/src/plugins/platforms/cocoa/qcocoakeymapper.mm @@ -395,7 +395,7 @@ KeyboardLayoutItem *QCocoaKeyMapper::keyMapForKey(unsigned short macVirtualKey, if (err == noErr && actualStringLength) unicodeKey = QChar(unicodeString[0]); - int qtkey = toKeyCode(unicodeKey, macVirtualKey, modifierKeyState); + int qtkey = toKeyCode(unicodeKey, macVirtualKey, qtModifiers); if (qtkey == Qt::Key_unknown) qtkey = unicodeKey.unicode();