all repos — mgba @ f0ff8d5f825f77d726d09fd33b75659c84dff970

mGBA Game Boy Advance Emulator

Qt: Fix invalid names for modifier keys (fixes #525)
Vicki Pfau vi@endrift.com
Fri, 14 Feb 2020 20:38:56 -0800
commit

f0ff8d5f825f77d726d09fd33b75659c84dff970

parent

a5fc8429eba86c2cf75546f8520e8e9cb2e6449f

2 files changed, 31 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -40,6 +40,7 @@ - Qt: Fix window title not updating after shutting down game

- 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:
M src/platform/qt/KeyEditor.cppsrc/platform/qt/KeyEditor.cpp

@@ -9,6 +9,7 @@ #include "GamepadAxisEvent.h"

#include "GamepadButtonEvent.h" #include "ShortcutController.h" +#include <QCoreApplication> #include <QFontMetrics> #include <QKeyEvent>

@@ -32,7 +33,35 @@ } else {

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