diff --git a/CHANGES b/CHANGES index a645427b7..28bf0a790 100644 --- a/CHANGES +++ b/CHANGES @@ -40,6 +40,7 @@ Other fixes: - Qt: Fix GIF view not allowing manual filename entry - Qt: Fix non-GB build (fixes mgba.io/i/1664) - Qt: Fix pausing Qt Multimedia audio (fixes mgba.io/i/1643) + - Qt: Fix invalid names for modifier keys (fixes mgba.io/i/525) - Util: Fix crash reading invalid ELFs - VFS: Fix handle leak when double-mapping (fixes mgba.io/i/1659) Misc: diff --git a/src/platform/qt/KeyEditor.cpp b/src/platform/qt/KeyEditor.cpp index f77dceb9b..38a1f48b5 100644 --- a/src/platform/qt/KeyEditor.cpp +++ b/src/platform/qt/KeyEditor.cpp @@ -9,6 +9,7 @@ #include "GamepadButtonEvent.h" #include "ShortcutController.h" +#include #include #include @@ -32,7 +33,35 @@ void KeyEditor::setValue(int key) { if (key < 0) { setText(tr("---")); } else { - setText(QKeySequence(key).toString(QKeySequence::NativeText)); + QKeySequence seq(key); + switch (key) { +#ifndef Q_OS_MAC + case Qt::Key_Shift: + setText(QCoreApplication::translate("QShortcut", "Shift")); + break; + case Qt::Key_Control: + setText(QCoreApplication::translate("QShortcut", "Control")); + break; + case Qt::Key_Alt: + setText(QCoreApplication::translate("QShortcut", "Alt")); + break; + case Qt::Key_Meta: + setText(QCoreApplication::translate("QShortcut", "Meta")); + break; +#endif + case Qt::Key_Super_L: + setText(tr("Super (L)")); + break; + case Qt::Key_Super_R: + setText(tr("Super (R)")); + break; + case Qt::Key_Menu: + setText(tr("Menu")); + break; + default: + setText(QKeySequence(key).toString(QKeySequence::NativeText)); + break; + } } } emit valueChanged(key);