From 09bdb1cb3e99ca04af6eee8ae2b9587ae85562fe Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 23 Mar 2011 12:59:59 +0000 Subject: [PATCH] Add WXK_CONTROL_A..WXK_CONTROL_Z constants. These key codes provide nicer symbolic values for ASCII values in 1..26 range generated by Ctrl+Letter keys. Closes #13075. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67294 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + include/wx/defs.h | 27 +++++++++++++++++++++++++++ interface/wx/event.h | 2 ++ 3 files changed, 30 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index cfaa93a461..a2da01c5ce 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -495,6 +495,7 @@ All (GUI): - Added support for reading image resolutions from PNG images (scottb). - wxComboCtrl, wxOwnerDrawnComboBox: better support for themed and custom panel backgrounds, especially on OS X. +- Add WXK_CONTROL_A..WXK_CONTROL_Z constants (Jan van Dijk). GTK: diff --git a/include/wx/defs.h b/include/wx/defs.h index 6130fae99b..68e9dad5f7 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -2354,6 +2354,33 @@ enum wxKeyCode { WXK_NONE = 0, + WXK_CONTROL_A = 1, + WXK_CONTROL_B, + WXK_CONTROL_C, + WXK_CONTROL_D, + WXK_CONTROL_E, + WXK_CONTROL_F, + WXK_CONTROL_G, + WXK_CONTROL_H, + WXK_CONTROL_I, + WXK_CONTROL_J, + WXK_CONTROL_K, + WXK_CONTROL_L, + WXK_CONTROL_M, + WXK_CONTROL_N, + WXK_CONTROL_O, + WXK_CONTROL_P, + WXK_CONTROL_Q, + WXK_CONTROL_R, + WXK_CONTROL_S, + WXK_CONTROL_T, + WXK_CONTROL_U, + WXK_CONTROL_V, + WXK_CONTROL_W, + WXK_CONTROL_X, + WXK_CONTROL_Y, + WXK_CONTROL_Z, + WXK_BACK = 8, // backspace WXK_TAB = 9, WXK_RETURN = 13, diff --git a/interface/wx/event.h b/interface/wx/event.h index 24e6942a95..a3d0022978 100644 --- a/interface/wx/event.h +++ b/interface/wx/event.h @@ -1252,6 +1252,8 @@ enum wxKeyCategoryFlags Notice that currently no translation is done for the presses of @c [, @c \\, @c ], @c ^ and @c _ keys which might be mapped to ASCII values from 27 to 31. + Since version 2.9.2, the enum values @c WXK_CONTROL_A - @c WXK_CONTROL_Z + can be used instead of the non-descriptive constant values 1-26. Finally, modifier keys only generate key events but no char events at all. The modifiers keys are @c WXK_SHIFT, @c WXK_CONTROL, @c WXK_ALT and various -- 2.45.2