Fix ASCII code used in accelerator menus for BkSp key (Linux only)

On Linux (GTK?) the accelerator key BkSp, when used in menus must be coded as "\t\b" and not "\tBkSp".
However, On Windows, it must be "\tBkSp".
Joys of multi-platform development.
This commit is contained in:
jean-pierre charras 2018-08-09 17:55:08 +02:00
parent 3eb3db02c3
commit 78ab5c3f07
1 changed files with 14 additions and 0 deletions

View File

@ -260,6 +260,13 @@ wxString AddHotkeyName( const wxString& aText, EDA_HOTKEY** aList,
switch( aShortCutType )
{
case IS_HOTKEY:
#ifdef __LINUX__
// In menus, some special keys (BkSp) must be coded by the
// actual ASCII value, not an equivalent name
if( keyname.EndsWith( "BkSp") )
keyname.Replace( "BkSp", "\b" );
#endif
msg << wxT( "\t" ) << keyname;
break;
@ -314,6 +321,13 @@ wxString AddHotkeyName( const wxString& aText,
switch( aShortCutType )
{
case IS_HOTKEY:
#ifdef __LINUX__
// In menus, some special keys (BkSp) must be coded by the
// actual ASCII value, not an equivalent name
if( keyname.EndsWith( "BkSp") )
keyname.Replace( "BkSp", "\b" );
#endif
msg << wxT( "\t" ) << keyname;
break;