defs.h

Enumerado wxKeyCode

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,
    WXK_ESCAPE  =    27,

    /* values from 33 to 126 are reserved for the standard ASCII characters */

    WXK_SPACE   =    32,
    WXK_DELETE  =    127,

    /* values from 128 to 255 are reserved for ASCII extended characters
       (note that there isn't a single fixed standard for the meaning
       of these values; avoid them in portable apps!) */

    /* These are not compatible with unicode characters.
       If you want to get a unicode character from a key event, use
       wxKeyEvent::GetUnicodeKey                                    */
    WXK_START   = 300,
    WXK_LBUTTON,
    WXK_RBUTTON,
    WXK_CANCEL,
    WXK_MBUTTON,
    WXK_CLEAR,
    WXK_SHIFT,
    WXK_ALT,
    WXK_CONTROL,
    WXK_MENU,
    WXK_PAUSE,
    WXK_CAPITAL,
    WXK_END,
    WXK_HOME,
    WXK_LEFT,
    WXK_UP,
    WXK_RIGHT,
    WXK_DOWN,
    WXK_SELECT,
    WXK_PRINT,
    WXK_EXECUTE,
    WXK_SNAPSHOT,
    WXK_INSERT,
    WXK_HELP,
    WXK_NUMPAD0,
    WXK_NUMPAD1,
    WXK_NUMPAD2,
    WXK_NUMPAD3,
    WXK_NUMPAD4,
    WXK_NUMPAD5,
    WXK_NUMPAD6,
    WXK_NUMPAD7,
    WXK_NUMPAD8,
    WXK_NUMPAD9,
    WXK_MULTIPLY,
    WXK_ADD,
    WXK_SEPARATOR,
    WXK_SUBTRACT,
    WXK_DECIMAL,
    WXK_DIVIDE,
    WXK_F1,
    WXK_F2,
    WXK_F3,
    WXK_F4,
    WXK_F5,
    WXK_F6,
    WXK_F7,
    WXK_F8,
    WXK_F9,
    WXK_F10,
    WXK_F11,
    WXK_F12,
    WXK_F13,
    WXK_F14,
    WXK_F15,
    WXK_F16,
    WXK_F17,
    WXK_F18,
    WXK_F19,
    WXK_F20,
    WXK_F21,
    WXK_F22,
    WXK_F23,
    WXK_F24,
    WXK_NUMLOCK,
    WXK_SCROLL,
    WXK_PAGEUP,
    WXK_PAGEDOWN,
    WXK_NUMPAD_SPACE,
    WXK_NUMPAD_TAB,
    WXK_NUMPAD_ENTER,
    WXK_NUMPAD_F1,
    WXK_NUMPAD_F2,
    WXK_NUMPAD_F3,
    WXK_NUMPAD_F4,
    WXK_NUMPAD_HOME,
    WXK_NUMPAD_LEFT,
    WXK_NUMPAD_UP,
    WXK_NUMPAD_RIGHT,
    WXK_NUMPAD_DOWN,
    WXK_NUMPAD_PAGEUP,
    WXK_NUMPAD_PAGEDOWN,
    WXK_NUMPAD_END,
    WXK_NUMPAD_BEGIN,
    WXK_NUMPAD_INSERT,
    WXK_NUMPAD_DELETE,
    WXK_NUMPAD_EQUAL,
    WXK_NUMPAD_MULTIPLY,
    WXK_NUMPAD_ADD,
    WXK_NUMPAD_SEPARATOR,
    WXK_NUMPAD_SUBTRACT,
    WXK_NUMPAD_DECIMAL,
    WXK_NUMPAD_DIVIDE,

    WXK_WINDOWS_LEFT,
    WXK_WINDOWS_RIGHT,
    WXK_WINDOWS_MENU ,
#ifdef __WXOSX__
    WXK_RAW_CONTROL,
#else
    WXK_RAW_CONTROL = WXK_CONTROL,
#endif
    WXK_COMMAND = WXK_CONTROL,

    /* Hardware-specific buttons */
    WXK_SPECIAL1 = WXK_WINDOWS_MENU + 2, /* Skip WXK_RAW_CONTROL if necessary */
    WXK_SPECIAL2,
    WXK_SPECIAL3,
    WXK_SPECIAL4,
    WXK_SPECIAL5,
    WXK_SPECIAL6,
    WXK_SPECIAL7,
    WXK_SPECIAL8,
    WXK_SPECIAL9,
    WXK_SPECIAL10,
    WXK_SPECIAL11,
    WXK_SPECIAL12,
    WXK_SPECIAL13,
    WXK_SPECIAL14,
    WXK_SPECIAL15,
    WXK_SPECIAL16,
    WXK_SPECIAL17,
    WXK_SPECIAL18,
    WXK_SPECIAL19,
    WXK_SPECIAL20,

    WXK_BROWSER_BACK,
    WXK_BROWSER_FORWARD,
    WXK_BROWSER_REFRESH,
    WXK_BROWSER_STOP,
    WXK_BROWSER_SEARCH,
    WXK_BROWSER_FAVORITES,
    WXK_BROWSER_HOME,
    WXK_VOLUME_MUTE,
    WXK_VOLUME_DOWN,
    WXK_VOLUME_UP,
    WXK_MEDIA_NEXT_TRACK,
    WXK_MEDIA_PREV_TRACK,
    WXK_MEDIA_STOP,
    WXK_MEDIA_PLAY_PAUSE,
    WXK_LAUNCH_MAIL,

    // 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,
    WXK_LAUNCH_3,
    WXK_LAUNCH_4,
    WXK_LAUNCH_5,
    WXK_LAUNCH_6,
    WXK_LAUNCH_7,
    WXK_LAUNCH_8,
    WXK_LAUNCH_9,
    WXK_LAUNCH_A,
    WXK_LAUNCH_B,
    WXK_LAUNCH_C,
    WXK_LAUNCH_D,
    WXK_LAUNCH_E,
    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
};

Keycodes virtuales utilizados por wxKeyEvent y algunas otras funciones de wxWidgets.

Hay que tener en cuenta que el rango 0..255 corresponde a los caracteres de la configuración regional actual, en particular el subrango 32..127 es para los símbolos ASCII, y todos los valores de teclas especiales como WXK_END se encuentran por encima de este rango.

Miembros/valores

WXK_NONE

Ninguna tecla.

Este valor es devuelto por wxKeyEvent::GetKeyCode() si no hay representación no Unicode para la tecla pulsada (por ejemplo, se ha introducido una letra cirílica cuando no se utiliza una configuración regional cirílica) y por wxKeyEvent::GetUnicodeKey() si no hay representación Unicode para la tecla (esto ocurre solo para las teclas especiales, no imprimibles, por ejemplo, WXK_HOME).

WXK_CONTROL_A .. WXK_CONTROL_Z
WXK_BACK
Retroceso.
WXK_TAB
WXK_RETURN
WXK_ESCAPE
WXK_SPACE
WXK_DELETE
WXK_START

Valores de clave especiales.

Estos son, por diseño, no compatibles con caracteres Unicode. Si se desea obtener un carácter Unicode de un evento clave, utilizar wxKeyEvent::GetUnicodeKey() en su lugar.

WXK_LBUTTON
WXK_RBUTTON
WXK_CANCEL
WXK_MBUTTON
WXK_CLEAR
WXK_SHIFT
WXK_ALT
WXK_CONTROL

Hay que tener en cuenta que en macOS, para mejorar la compatibilidad con otros sistemas, 'WXK_CONTROL' representa la tecla 'Comando'.

Utilizar esta constante para trabajar con atajos de teclado. Consultar "WXK_RAW_CONTROL" para obtener el estado de la tecla "Control".

WXK_WINDOWS_LEFT
WXK_WINDOWS_RIGHT
WXK_WINDOWS_MENU
Estos códigos clave solo se generan actualmente en Windows.
WXK_COMMAND

Este código de tecla especial se utilizó para representar la tecla utilizada para los atajos de teclado.

En macOS, esta tecla corresponde a la tecla "Command" (también conocida como logo o "Apple"), mientras que en Linux/Windows/otros es la tecla Control. Con la nueva semántica de WXK_CONTROL, WXK_COMMAND ya no es necesaria.

WXK_SPECIAL1 .. WXK_SPECIAL20
Botones específicos del hardware.
WXK_BROWSER_BACK .. WXK_LAUNCH_APP2
A partir de wzWidgets 3.1.0
WXK_LAUNCH_APP1

Primera tecla de lanzamiento de la aplicación.

Hay que tener en cuenta que esta constante tiene el mismo valor que WXK_LAUNCH_A.

WXK_LAUNCH_APP2

Segunda tecla de lanzamiento de la aplicación.

Hay que tener en cuenta que esta constante tiene el mismo valor que WXK_LAUNCH_B.

WXK_LAUNCH_0 .. WXK_LAUNCH_F
Disponible desde wxWidgets 3.1.6 y solo generado por wxGTK.
WXK_LAUNCH_A y WXK_LAUNCH_B
Disponible desde wxWidgets 3.1.6, generado por wxGTK y wxMSW.