macOS: Map Qt::KeyboardModifier to a single Carbon modifier

The modifier is passed to UCKeyTranslate, and we don't need to turn
e.g. Qt::ShiftModifier into both shiftKey and rightShiftKey. One is
enough to map the virtual key to a unicode character.

Change-Id: I33c46c016df03ecf17b5d87885d80a6d581767bc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Tor Arne Vestbø 2020-07-07 21:05:53 +02:00
parent 055c2bebda
commit 45d4e4b06c

View File

@ -92,12 +92,9 @@ static CarbonModifiers toCarbonModifiers(Qt::KeyboardModifiers qtModifiers)
static constexpr std::tuple<int, Qt::KeyboardModifier> carbonModifierMap[] = {
{ shiftKey, Qt::ShiftModifier },
{ rightShiftKey, Qt::ShiftModifier },
{ controlKey, Qt::ControlModifier },
{ rightControlKey, Qt::ControlModifier },
{ cmdKey, Qt::MetaModifier },
{ optionKey, Qt::AltModifier },
{ rightOptionKey, Qt::AltModifier },
{ kEventKeyModifierNumLockMask, Qt::KeypadModifier }
};