re-add old special keys for mapping (Esc=cancel, Backspace=clear)

This commit is contained in:
Arisotura 2020-05-19 14:24:57 +02:00
parent 04d38e5e66
commit 4b038f5d37
1 changed files with 8 additions and 1 deletions

View File

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