wxKeyCode: add WXK_LAUNCH_[0-9A-F] for gtk bindings

X11 defines Xf86Launch[0-9a-f], which are then also defined as
GDK_KEY_Launch[0-9A-F].

Unfortunately, keys which are not mapped are just plain ignored and the
application is then not able to receive these keyboard events at all.

The original PR https://github.com/wxWidgets/wxWidgets/pull/157 mapped
only LaunchA/B to WXK_LAUNCH_APP1/2, this patch adds the whole range of
keys and keeps LAUNCH_A/B as aliases for WXK_LAUNCH_APP1/2
This commit is contained in:
Dominique Martinet
2021-11-01 16:10:00 +09:00
parent 9cc0c9a082
commit 61d835d8b3
4 changed files with 97 additions and 4 deletions

View File

@@ -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)