From 95988802f7ff001b5b724f9c878f6d9dc5c33ce9 Mon Sep 17 00:00:00 2001 From: Chris Pavlina Date: Fri, 15 Jan 2016 21:07:06 -0500 Subject: [PATCH] Fix special keys on Windows --- common/widgets/widget_hotkey_list.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/common/widgets/widget_hotkey_list.cpp b/common/widgets/widget_hotkey_list.cpp index a3bc67f0da..0ab6b77cad 100644 --- a/common/widgets/widget_hotkey_list.cpp +++ b/common/widgets/widget_hotkey_list.cpp @@ -166,6 +166,22 @@ public: else { m_event = aEvent; + + // EVT_CHAR_HOOK returns some incorrect keys (shift+symbol, + // in particular). If the key is an ASCII printable, grab the + // code from GetUnicodeKey instead. + + // TODO: Make the whole hotkey system support Unicode keys. + + if( aEvent.GetKeyCode() >= '!' && aEvent.GetKeyCode() <= '~' ) + { + if( aEvent.GetEventType() == wxEVT_CHAR_HOOK ) + { + aEvent.DoAllowNextEvent(); + return; + } + } + EndFlexible( wxID_OK ); } }