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 <timur.pocheptsov@qt.io>
bb10
Tor Arne Vestbø 2020-06-28 16:13:52 +02:00
parent 3021b1ecb7
commit a5c6329829
1 changed files with 1 additions and 1 deletions

View File

@ -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();