debug_console: correct name scancode to keycode

QKeyEvent()->nativeScanCode() actually reports the keycode generated by
the kernel, not the scancode generated by the hardware.
This commit is contained in:
Yifan Zhu 2024-08-16 09:20:16 -07:00
parent d07ce95617
commit 0eba9e631e

View file

@ -294,7 +294,7 @@ void DebugConsoleFilter::keyEvent(KeyEvent *event)
const auto keyMetaObject = Qt::qt_getEnumMetaObject(Qt::Key());
const auto enumerator = keyMetaObject->enumerator(keyMetaObject->indexOfEnumerator("Key"));
text.append(tableRow(i18nc("The code as read from the input device", "Scan code"), event->nativeScanCode()));
text.append(tableRow(i18nc("The code reported by the kernel", "Keycode"), event->nativeScanCode()));
text.append(tableRow(i18nc("Key according to Qt", "Qt::Key code"),
enumerator.valueToKey(event->key())));
text.append(tableRow(i18nc("The translated code to an Xkb symbol", "Xkb symbol"), event->nativeVirtualKey()));