From a9a2470acee9f45feac8ddacf2f1c1bf2ee22959 Mon Sep 17 00:00:00 2001 From: Sven Eberhardt Date: Sat, 14 Dec 2013 12:24:07 +0100 Subject: [PATCH] Fix accelerator hotkeys. They were broken since keys aren't passed as VK-codes but as scancodes now. Tested under Windows only. --- src/gui/C4GuiDialogs.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/C4GuiDialogs.cpp b/src/gui/C4GuiDialogs.cpp index 8e2bfd28d..822c04837 100644 --- a/src/gui/C4GuiDialogs.cpp +++ b/src/gui/C4GuiDialogs.cpp @@ -526,8 +526,10 @@ namespace C4GUI bool Dialog::KeyHotkey(const C4KeyCodeEx &key) { - WORD wKey = WORD(key.Key); + StdStrBuf sKey = C4KeyCodeEx::KeyCode2String(key.Key, true, true); // do hotkey procs for standard alphanumerics only + if (sKey.getLength() != 1) return false; + WORD wKey = WORD(*sKey.getData()); if (Inside(TOUPPERIFX11(wKey), 'A', 'Z')) if (OnHotkey(char(TOUPPERIFX11(wKey)))) return true; if (Inside(TOUPPERIFX11(wKey), '0', '9')) if (OnHotkey(char(TOUPPERIFX11(wKey)))) return true; return false;