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; }