macOS: Improve QAppleKeyMapper logging
Pick-to: 6.2 Change-Id: If0018f2a1c8809e66b695949e8dc7b463c4612a6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>bb10
parent
11214f4c42
commit
6ecd157487
|
|
@ -551,7 +551,7 @@ const QAppleKeyMapper::KeyMap &QAppleKeyMapper::keyMapForKey(VirtualKeyCode virt
|
|||
qCDebug(lcQpaKeyMapper).verbosity(0) << "\t" << qtModifiers
|
||||
<< "+" << qUtf8Printable(QString::asprintf("0x%02x", virtualKey))
|
||||
<< "=" << qUtf8Printable(QString::asprintf("%d / 0x%02x /", qtKey, qtKey))
|
||||
<< QString::asprintf("%c", qtKey);
|
||||
<< QString(QChar(qtKey));
|
||||
}
|
||||
|
||||
return keyMap;
|
||||
|
|
@ -578,6 +578,8 @@ QList<int> QAppleKeyMapper::possibleKeys(const QKeyEvent *event) const
|
|||
{
|
||||
QList<int> ret;
|
||||
|
||||
qCDebug(lcQpaKeyMapper) << "Computing possible keys for" << event;
|
||||
|
||||
const auto nativeVirtualKey = event->nativeVirtualKey();
|
||||
if (!nativeVirtualKey)
|
||||
return ret;
|
||||
|
|
@ -613,6 +615,17 @@ QList<int> QAppleKeyMapper::possibleKeys(const QKeyEvent *event) const
|
|||
}
|
||||
}
|
||||
|
||||
if (lcQpaKeyMapper().isDebugEnabled()) {
|
||||
qCDebug(lcQpaKeyMapper) << "Possible keys:";
|
||||
for (int keyAndModifiers : ret) {
|
||||
auto keyCombination = QKeyCombination::fromCombined(keyAndModifiers);
|
||||
auto keySequence = QKeySequence(keyCombination);
|
||||
qCDebug(lcQpaKeyMapper).verbosity(0) << "\t-"
|
||||
<< keyCombination << "/" << keySequence << "/"
|
||||
<< qUtf8Printable(keySequence.toString(QKeySequence::NativeText));
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue