mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix invalid names for modifier keys (fixes #525)
This commit is contained in:
parent
a5fc8429eb
commit
f0ff8d5f82
1
CHANGES
1
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:
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "GamepadButtonEvent.h"
|
||||
#include "ShortcutController.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QFontMetrics>
|
||||
#include <QKeyEvent>
|
||||
|
||||
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue