From 504ccb70442d4ec4fb7118fc4219ae81a290c56c Mon Sep 17 00:00:00 2001 From: Arisotura Date: Tue, 9 Jul 2019 18:41:44 +0200 Subject: [PATCH] don't allow modifier mappings in input config dialog, either --- src/libui_sdl/DlgInputConfig.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libui_sdl/DlgInputConfig.cpp b/src/libui_sdl/DlgInputConfig.cpp index 3818c048..a80e2ec7 100644 --- a/src/libui_sdl/DlgInputConfig.cpp +++ b/src/libui_sdl/DlgInputConfig.cpp @@ -232,10 +232,12 @@ int OnAreaKeyEvent(uiAreaHandler* handler, uiArea* area, uiAreaKeyEvent* evt) // set key. if (evt->Scancode != 0x1 || evt->Modifiers != 0) // ESC { + int mod = (dlg->type == 0) ? 0 : evt->Modifiers; + if (evt->Scancode == 0xE && evt->Modifiers == 0) // backspace dlg->keymap[dlg->pollid] = -1; else - dlg->keymap[dlg->pollid] = evt->Scancode | (evt->Modifiers << 16); + dlg->keymap[dlg->pollid] = evt->Scancode | (mod << 16); } char keyname[64];