aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2020-05-19 14:24:57 +0200
committerArisotura <thetotalworm@gmail.com>2020-05-19 14:24:57 +0200
commit4b038f5d370c961803666f418ebfeb775cfa2d2a (patch)
treed3e8d3b8ab0e3a98c4b4eb520fba0c18e0884caa
parent04d38e5e66cee768e32864b37a5cf37d8109d481 (diff)
re-add old special keys for mapping (Esc=cancel, Backspace=clear)
-rw-r--r--src/frontend/qt_sdl/InputConfigDialog.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/frontend/qt_sdl/InputConfigDialog.cpp b/src/frontend/qt_sdl/InputConfigDialog.cpp
index 0ef29bb..93204aa 100644
--- a/src/frontend/qt_sdl/InputConfigDialog.cpp
+++ b/src/frontend/qt_sdl/InputConfigDialog.cpp
@@ -236,12 +236,19 @@ void KeyMapButton::keyPressEvent(QKeyEvent* event)
printf("KEY PRESSED = %08X %08X | %08X %08X %08X\n", event->key(), event->modifiers(), event->nativeVirtualKey(), event->nativeModifiers(), event->nativeScanCode());
int key = event->key();
+ int mod = event->modifiers();
bool ismod = (key == Qt::Key_Control ||
key == Qt::Key_Alt ||
key == Qt::Key_AltGr ||
key == Qt::Key_Shift ||
key == Qt::Key_Meta);
+ if (!mod)
+ {
+ if (key == Qt::Key_Escape) { click(); return; }
+ if (key == Qt::Key_Backspace) { *mapping = -1; click(); return; }
+ }
+
if (isHotkey)
{
if (ismod)
@@ -249,7 +256,7 @@ void KeyMapButton::keyPressEvent(QKeyEvent* event)
}
if (!ismod)
- key |= event->modifiers();
+ key |= mod;
else if (IsRightModKey(event))
key |= (1<<31);