diff --git a/include/wx/defs.h b/include/wx/defs.h index 09b35e7572..30f4191ce6 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -2434,7 +2434,25 @@ enum wxKeyCode WXK_MEDIA_PLAY_PAUSE, WXK_LAUNCH_MAIL, WXK_LAUNCH_APP1, - WXK_LAUNCH_APP2 + WXK_LAUNCH_APP2, + WXK_LAUNCH_0, + WXK_LAUNCH_1, + WXK_LAUNCH_2, + WXK_LAUNCH_3, + WXK_LAUNCH_4, + WXK_LAUNCH_5, + WXK_LAUNCH_6, + WXK_LAUNCH_7, + WXK_LAUNCH_8, + WXK_LAUNCH_9, + /* Alias for backwards compatibility with old gtk bindings, + * then continue from LAUNCH_9 */ + WXK_LAUNCH_A = WXK_LAUNCH_APP1, + WXK_LAUNCH_B = WXK_LAUNCH_APP2, + WXK_LAUNCH_C = WXK_LAUNCH_9 + 1, + WXK_LAUNCH_D, + WXK_LAUNCH_E, + WXK_LAUNCH_F }; /* This enum contains bit mask constants used in wxKeyEvent */ diff --git a/interface/wx/defs.h b/interface/wx/defs.h index 992b46c84b..526f502ead 100644 --- a/interface/wx/defs.h +++ b/interface/wx/defs.h @@ -1080,7 +1080,25 @@ enum wxKeyCode WXK_MEDIA_PLAY_PAUSE, WXK_LAUNCH_MAIL, WXK_LAUNCH_APP1, - WXK_LAUNCH_APP2 + WXK_LAUNCH_APP2, + WXK_LAUNCH_0, + WXK_LAUNCH_1, + WXK_LAUNCH_2, + WXK_LAUNCH_3, + WXK_LAUNCH_4, + WXK_LAUNCH_5, + WXK_LAUNCH_6, + WXK_LAUNCH_7, + WXK_LAUNCH_8, + WXK_LAUNCH_9, + /* Alias for backwards compatibility with old gtk bindings, + * then continue from LAUNCH_9 */ + WXK_LAUNCH_A = WXK_LAUNCH_APP1, + WXK_LAUNCH_B = WXK_LAUNCH_APP2, + WXK_LAUNCH_C = WXK_LAUNCH_9 + 1, + WXK_LAUNCH_D, + WXK_LAUNCH_E, + WXK_LAUNCH_F }; /** diff --git a/samples/keyboard/keyboard.cpp b/samples/keyboard/keyboard.cpp index f649cb98c4..5b4816afae 100644 --- a/samples/keyboard/keyboard.cpp +++ b/samples/keyboard/keyboard.cpp @@ -493,6 +493,21 @@ const char* GetVirtualKeyCodeName(int keycode) WXK_(LAUNCH_MAIL) WXK_(LAUNCH_APP1) WXK_(LAUNCH_APP2) + WXK_(LAUNCH_0) + WXK_(LAUNCH_1) + WXK_(LAUNCH_2) + WXK_(LAUNCH_3) + WXK_(LAUNCH_4) + WXK_(LAUNCH_5) + WXK_(LAUNCH_6) + WXK_(LAUNCH_7) + WXK_(LAUNCH_8) + WXK_(LAUNCH_9) + // skip A/B which are duplicate cases of APP1/2 + WXK_(LAUNCH_C) + WXK_(LAUNCH_D) + WXK_(LAUNCH_E) + WXK_(LAUNCH_F) #undef WXK_ default: diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index dbee540948..23f7576f9d 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -870,11 +870,53 @@ static long wxTranslateKeySymToWXKey(KeySym keysym, bool isChar) case GDK_KEY_Mail: key_code = WXK_LAUNCH_MAIL; break; + case GDK_KEY_Launch0: + key_code = WXK_LAUNCH_0; + break; + case GDK_KEY_Launch1: + key_code = WXK_LAUNCH_1; + break; + case GDK_KEY_Launch2: + key_code = WXK_LAUNCH_2; + break; + case GDK_KEY_Launch3: + key_code = WXK_LAUNCH_3; + break; + case GDK_KEY_Launch4: + key_code = WXK_LAUNCH_4; + break; + case GDK_KEY_Launch5: + key_code = WXK_LAUNCH_5; + break; + case GDK_KEY_Launch6: + key_code = WXK_LAUNCH_6; + break; + case GDK_KEY_Launch7: + key_code = WXK_LAUNCH_7; + break; + case GDK_KEY_Launch8: + key_code = WXK_LAUNCH_8; + break; + case GDK_KEY_Launch9: + key_code = WXK_LAUNCH_9; + break; case GDK_KEY_LaunchA: - key_code = WXK_LAUNCH_APP1; + key_code = WXK_LAUNCH_A; break; case GDK_KEY_LaunchB: - key_code = WXK_LAUNCH_APP2; + key_code = WXK_LAUNCH_B; + break; + case GDK_KEY_LaunchC: + key_code = WXK_LAUNCH_C; + break; + case GDK_KEY_LaunchD: + key_code = WXK_LAUNCH_D; + break; + case GDK_KEY_LaunchE: + key_code = WXK_LAUNCH_E; + break; + case GDK_KEY_LaunchF: + key_code = WXK_LAUNCH_F; break; #endif // GTK_CHECK_VERSION(2,18,0)