From 37f062d32500c8fdc3047332bd87a5ebeb6b8f41 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 23 Nov 2018 09:04:21 +0100 Subject: [PATCH] Make Ctrl+'A' to Ctrl+'Z' working again (Issue specific to Windows and Linux) Fixes: lp:1804326 https://bugs.launchpad.net/kicad/+bug/1804326 --- common/tool/tool_dispatcher.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/tool/tool_dispatcher.cpp b/common/tool/tool_dispatcher.cpp index 9901c6bb7f..689a3cb501 100644 --- a/common/tool/tool_dispatcher.cpp +++ b/common/tool/tool_dispatcher.cpp @@ -397,7 +397,16 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent ) // char events for ASCII letters in this case carry codes corresponding to the ASCII // value of Ctrl-Latter, i.e. 1 for Ctrl-A, 2 for Ctrl-B and so on until 26 for Ctrl-Z. // They are remapped here to be more easy to handle in code + // Note also on OSX wxWidgets has a differnt behavior and the mapping is made + // only for ctrl+'A' to ctlr+'Z' (unicode code return 'A' to 'Z'). + // Others OS return WXK_CONTROL_A to WXK_CONTROL_Z, and Ctrl+'M' returns the same code as + // the return key, so the remapping does not use the unicode key value. +#ifdef __APPLE__ if( unicode >= 'A' && unicode <= 'Z' && key >= WXK_CONTROL_A && key <= WXK_CONTROL_Z ) +#else + (void) unicode; //not used: avoid compil warning + if( key >= WXK_CONTROL_A && key <= WXK_CONTROL_Z ) +#endif key += 'A' - 1; }