Make WXK_LAUNCH_x constants consecutive
No real changes, but don't complicate the constants definitions needlessly just to avoid changing the numeric value of WXK_LAUNCH_APP constants as nobody should rely on them anyhow. Not doing it simplifies things and allows to condense the mapping from GDK keys to wx ones.
This commit is contained in:
@@ -2433,8 +2433,9 @@ enum wxKeyCode
|
||||
WXK_MEDIA_STOP,
|
||||
WXK_MEDIA_PLAY_PAUSE,
|
||||
WXK_LAUNCH_MAIL,
|
||||
WXK_LAUNCH_APP1,
|
||||
WXK_LAUNCH_APP2,
|
||||
|
||||
// Events for these keys are currently only generated by wxGTK, with the
|
||||
// exception of WXK_LAUNCH_{A,B}, see WXK_LAUNCH_APP{1,2} below.
|
||||
WXK_LAUNCH_0,
|
||||
WXK_LAUNCH_1,
|
||||
WXK_LAUNCH_2,
|
||||
@@ -2445,14 +2446,17 @@ enum wxKeyCode
|
||||
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_A,
|
||||
WXK_LAUNCH_B,
|
||||
WXK_LAUNCH_C,
|
||||
WXK_LAUNCH_D,
|
||||
WXK_LAUNCH_E,
|
||||
WXK_LAUNCH_F
|
||||
WXK_LAUNCH_F,
|
||||
|
||||
// These constants are the same as the corresponding GTK keys, so give them
|
||||
// the same value, but they are also generated by wxMSW.
|
||||
WXK_LAUNCH_APP1 = WXK_LAUNCH_A,
|
||||
WXK_LAUNCH_APP2 = WXK_LAUNCH_B
|
||||
};
|
||||
|
||||
/* This enum contains bit mask constants used in wxKeyEvent */
|
||||
|
@@ -870,53 +870,24 @@ 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_A;
|
||||
break;
|
||||
case GDK_KEY_LaunchB:
|
||||
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;
|
||||
key_code = WXK_LAUNCH_0 + (keysym - GDK_KEY_Launch0);
|
||||
break;
|
||||
#endif // GTK_CHECK_VERSION(2,18,0)
|
||||
|
||||
|
Reference in New Issue
Block a user