aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/qt_sdl
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2020-05-19 13:46:31 +0200
committerStapleButter <thetotalworm@gmail.com>2020-05-19 13:46:31 +0200
commit2a7027f794267effe651b242956ed669c242e9ca (patch)
treedaf1717833f43980f6e5b274fb7364ef58d3f871 /src/frontend/qt_sdl
parent9fbf9b997bb950a667d0af4583fd68098a7ed717 (diff)
add AltGr, weak attempt at blocking garbage key names
Diffstat (limited to 'src/frontend/qt_sdl')
-rw-r--r--src/frontend/qt_sdl/InputConfigDialog.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/frontend/qt_sdl/InputConfigDialog.cpp b/src/frontend/qt_sdl/InputConfigDialog.cpp
index 3b006fd..54251a1 100644
--- a/src/frontend/qt_sdl/InputConfigDialog.cpp
+++ b/src/frontend/qt_sdl/InputConfigDialog.cpp
@@ -235,6 +235,7 @@ printf("KEY PRESSED = %08X %08X | %08X %08X %08X | %08X\n", event->key(), event-
int key = event->key();
bool ismod = (key == Qt::Key_Control ||
key == Qt::Key_Alt ||
+ key == Qt::Key_AltGr ||
key == Qt::Key_Shift ||
key == Qt::Key_Meta);
@@ -284,11 +285,17 @@ QString KeyMapButton::mappingText()
case Qt::Key_Control: return "Ctrl";
case Qt::Key_Alt: return "Alt";
+ case Qt::Key_AltGr: return "AltGr";
case Qt::Key_Shift: return "Shift";
case Qt::Key_Meta: return "Meta";
}
QKeySequence seq(key);
QString ret = seq.toString();
+
+ // weak attempt at detecting garbage key names
+ if (ret.length() == 2 && ret[0].unicode() > 0xFF)
+ return QString("[%1]").arg(key, 8, 16);
+
return ret.replace("&", "&&");
}