First pass implementation of new SDL scancode concept, as discussed with
Christian Walther. Currently only implemented on Mac OS X for sanity checking purposes. --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402715
This commit is contained in:
parent
844280a6a9
commit
02f2e328bd
16 changed files with 1575 additions and 1335 deletions
|
@ -130,47 +130,54 @@ typedef enum
|
|||
|
||||
struct SDL_SysWMinfo;
|
||||
|
||||
/* Key codes
|
||||
Note that the correspondences defined here are approximate at best because
|
||||
the meaning of the event structure field that carries these values has
|
||||
changed: in SDL 1.2, it referred to the key's label in the current keyboard
|
||||
layout, whereas now it refers to a specific physical key on the keyboard,
|
||||
regardless of the keyboard layout setting.
|
||||
To get comparable behavior to SDL 1.2, code that uses any of the codes below
|
||||
in ways like "if (somekey == SDLK_EXCLAIM)" should be changed to the
|
||||
equivalent of "if (SDL_GetLayoutKey(somekey) == '!')".
|
||||
*/
|
||||
/* Obsolete or renamed key codes */
|
||||
|
||||
/* These key constants were renamed for clarity or consistence. */
|
||||
#define SDLK_QUOTE SDLK_APOSTROPHE
|
||||
#define SDLK_MINUS SDLK_HYPHENMINUS
|
||||
#define SDLK_BACKQUOTE SDLK_GRAVE
|
||||
#define SDLK_a SDLK_A
|
||||
#define SDLK_b SDLK_B
|
||||
#define SDLK_c SDLK_C
|
||||
#define SDLK_d SDLK_D
|
||||
#define SDLK_e SDLK_E
|
||||
#define SDLK_f SDLK_F
|
||||
#define SDLK_g SDLK_G
|
||||
#define SDLK_h SDLK_H
|
||||
#define SDLK_i SDLK_I
|
||||
#define SDLK_j SDLK_J
|
||||
#define SDLK_k SDLK_K
|
||||
#define SDLK_l SDLK_L
|
||||
#define SDLK_m SDLK_M
|
||||
#define SDLK_n SDLK_N
|
||||
#define SDLK_o SDLK_O
|
||||
#define SDLK_p SDLK_P
|
||||
#define SDLK_q SDLK_Q
|
||||
#define SDLK_r SDLK_R
|
||||
#define SDLK_s SDLK_S
|
||||
#define SDLK_t SDLK_T
|
||||
#define SDLK_u SDLK_U
|
||||
#define SDLK_v SDLK_V
|
||||
#define SDLK_w SDLK_W
|
||||
#define SDLK_x SDLK_X
|
||||
#define SDLK_y SDLK_Y
|
||||
#define SDLK_z SDLK_Z
|
||||
/* These key constants were renamed for clarity or consistency. */
|
||||
#define SDLK_a 'a'
|
||||
#define SDLK_b 'b'
|
||||
#define SDLK_c 'c'
|
||||
#define SDLK_d 'd'
|
||||
#define SDLK_e 'e'
|
||||
#define SDLK_f 'f'
|
||||
#define SDLK_g 'g'
|
||||
#define SDLK_h 'h'
|
||||
#define SDLK_i 'i'
|
||||
#define SDLK_j 'j'
|
||||
#define SDLK_k 'k'
|
||||
#define SDLK_l 'l'
|
||||
#define SDLK_m 'm'
|
||||
#define SDLK_n 'n'
|
||||
#define SDLK_o 'o'
|
||||
#define SDLK_p 'p'
|
||||
#define SDLK_q 'q'
|
||||
#define SDLK_r 'r'
|
||||
#define SDLK_s 's'
|
||||
#define SDLK_t 't'
|
||||
#define SDLK_u 'u'
|
||||
#define SDLK_v 'v'
|
||||
#define SDLK_w 'w'
|
||||
#define SDLK_x 'x'
|
||||
#define SDLK_y 'y'
|
||||
#define SDLK_z 'z'
|
||||
#define SDLK_QUOTE '\''
|
||||
#define SDLK_MINUS '-'
|
||||
#define SDLK_BACKQUOTE '`'
|
||||
#define SDLK_EXCLAIM '!'
|
||||
#define SDLK_QUOTEDBL '"'
|
||||
#define SDLK_HASH '#'
|
||||
#define SDLK_DOLLAR '$'
|
||||
#define SDLK_AMPERSAND '&'
|
||||
#define SDLK_LEFTPAREN '('
|
||||
#define SDLK_RIGHTPAREN ')'
|
||||
#define SDLK_ASTERISK '*'
|
||||
#define SDLK_PLUS '+'
|
||||
#define SDLK_COLON ':'
|
||||
#define SDLK_LESS '<'
|
||||
#define SDLK_GREATER '>'
|
||||
#define SDLK_QUESTION '?'
|
||||
#define SDLK_AT '@'
|
||||
#define SDLK_CARET '^'
|
||||
#define SDLK_UNDERSCORE '_'
|
||||
#define SDLK_KP0 SDLK_KP_0
|
||||
#define SDLK_KP1 SDLK_KP_1
|
||||
#define SDLK_KP2 SDLK_KP_2
|
||||
|
@ -181,30 +188,14 @@ struct SDL_SysWMinfo;
|
|||
#define SDLK_KP7 SDLK_KP_7
|
||||
#define SDLK_KP8 SDLK_KP_8
|
||||
#define SDLK_KP9 SDLK_KP_9
|
||||
#define SDLK_NUMLOCK SDLK_KP_NUMLOCKCLEAR
|
||||
#define SDLK_NUMLOCK SDLK_NUMLOCKCLEAR
|
||||
#define SDLK_SCROLLOCK SDLK_SCROLLLOCK
|
||||
#define SDLK_PRINT SDLK_PRINTSCREEN
|
||||
|
||||
/* These key constants are obsoleted by the new keyboard handling,
|
||||
their definitions here correspond to how they appear on a US
|
||||
keyboard. */
|
||||
|
||||
#define SDLK_EXCLAIM SDLK_1
|
||||
#define SDLK_QUOTEDBL SDLK_APOSTROPHE
|
||||
#define SDLK_HASH SDLK_3
|
||||
#define SDLK_DOLLAR SDLK_4
|
||||
#define SDLK_AMPERSAND SDLK_7
|
||||
#define SDLK_LEFTPAREN SDLK_9
|
||||
#define SDLK_RIGHTPAREN SDLK_0
|
||||
#define SDLK_ASTERISK SDLK_8
|
||||
#define SDLK_PLUS SDLK_EQUALS
|
||||
#define SDLK_COLON SDLK_SEMICOLON
|
||||
#define SDLK_LESS SDLK_COMMA
|
||||
#define SDLK_GREATER SDLK_PERIOD
|
||||
#define SDLK_QUESTION SDLK_SLASH
|
||||
#define SDLK_AT SDLK_2
|
||||
#define SDLK_CARET SDLK_6
|
||||
#define SDLK_UNDERSCORE SDLK_HYPHENMINUS
|
||||
/* The META modifier is equivalent to the GUI modifier from the USB standard */
|
||||
#define KMOD_LMETA KMOD_LGUI
|
||||
#define KMOD_RMETA KMOD_RGUI
|
||||
#define KMOD_META KMOD_GUI
|
||||
|
||||
/* These keys don't appear in the USB specification (or at least not under those names). I'm unsure if the following assignments make sense or if these codes should be defined as actual additional SDLK_ constants. */
|
||||
#define SDLK_LSUPER SDLK_LMETA
|
||||
|
@ -268,6 +259,7 @@ extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay * overlay);
|
|||
extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void);
|
||||
extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval);
|
||||
extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval);
|
||||
extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -48,8 +48,7 @@ extern "C" {
|
|||
*/
|
||||
typedef struct SDL_keysym
|
||||
{
|
||||
Uint8 scancode; /**< keyboard specific scancode */
|
||||
Uint8 padding[3]; /**< alignment padding */
|
||||
SDL_scancode scancode; /**< SDL physical key code - see ::SDL_scancode for details */
|
||||
SDLKey sym; /**< SDL virtual key code - see ::SDLKey for details */
|
||||
Uint16 mod; /**< current key modifiers */
|
||||
Uint32 unicode; /**< OBSOLETE, use SDL_TextInputEvent instead */
|
||||
|
@ -80,32 +79,19 @@ extern DECLSPEC int SDLCALL SDL_GetNumKeyboards(void);
|
|||
extern DECLSPEC int SDLCALL SDL_SelectKeyboard(int index);
|
||||
|
||||
/**
|
||||
* \fn int SDL_EnableUNICODE(int enable)
|
||||
*
|
||||
* \brief Enable/Disable UNICODE translation of keyboard input.
|
||||
*
|
||||
* \param enable 1 to enable translation, 0 to disable translation, -1 to query translation
|
||||
*
|
||||
* \return The previous state of keyboard translation
|
||||
*
|
||||
* \note This translation has some overhead, so translation defaults off.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
|
||||
|
||||
/**
|
||||
* \fn Uint8 *SDL_GetKeyState(int *numkeys)
|
||||
* \fn Uint8 *SDL_GetKeyboardState(int *numkeys)
|
||||
*
|
||||
* \brief Get a snapshot of the current state of the selected keyboard.
|
||||
*
|
||||
* \param numkeys if non-NULL, receives the length of the returned array.
|
||||
*
|
||||
* \return An array of key states. Indexes into this array are obtained by using the SDLK_INDEX() macro on the \link ::SDLPhysicalKey SDLK_* \endlink syms.
|
||||
* \return An array of key states. Indexes into this array are obtained by using ::SDL_scancode values.
|
||||
*
|
||||
* Example:
|
||||
* Uint8 *keystate = SDL_GetKeyState(NULL);
|
||||
* if ( keystate[SDLK_INDEX(SDLK_RETURN)] ) ... <RETURN> is pressed.
|
||||
* Uint8 *state = SDL_GetKeyboardState(NULL);
|
||||
* if ( state[SDL_SCANCODE_RETURN)] ) ... <RETURN> is pressed.
|
||||
*/
|
||||
extern DECLSPEC Uint8 *SDLCALL SDL_GetKeyState(int *numkeys);
|
||||
extern DECLSPEC Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
|
||||
|
||||
/**
|
||||
* \fn SDLMod SDL_GetModState(void)
|
||||
|
@ -124,32 +110,49 @@ extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void);
|
|||
extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate);
|
||||
|
||||
/**
|
||||
* \fn SDLKey SDL_GetLayoutKey(SDLKey physicalKey)
|
||||
* \fn SDLKey SDL_GetKeyFromScancode(SDL_scancode scancode)
|
||||
*
|
||||
* \brief Get the layout key code corresponding to the given physical key code according to the current keyboard layout.
|
||||
* \brief Get the key code corresponding to the given scancode according to the current keyboard layout.
|
||||
*
|
||||
* See ::SDLKey for details.
|
||||
*
|
||||
* If \a physicalKey is not a physical key code, it is returned unchanged.
|
||||
*
|
||||
* \sa SDL_GetKeyName()
|
||||
*/
|
||||
extern DECLSPEC SDLKey SDLCALL SDL_GetLayoutKey(SDLKey physicalKey);
|
||||
extern DECLSPEC SDLKey SDLCALL SDL_GetKeyFromScancode(SDL_scancode scancode);
|
||||
|
||||
/**
|
||||
* \fn const char *SDL_GetKeyName(SDLKey layoutKey)
|
||||
* \fn SDL_scancode SDL_GetScancodeFromKey(SDLKey key)
|
||||
*
|
||||
* \brief Get the scancode corresponding to the given key code according to the current keyboard layout.
|
||||
*
|
||||
* See ::SDL_scancode for details.
|
||||
*
|
||||
* \sa SDL_GetScancodeName()
|
||||
*/
|
||||
extern DECLSPEC SDL_scancode SDLCALL SDL_GetScancodeFromKey(SDLKey key);
|
||||
|
||||
/**
|
||||
* \fn const char *SDL_GetScancodeName(SDL_scancode scancode)
|
||||
*
|
||||
* \brief Get a human-readable name for a scancode.
|
||||
*
|
||||
* \return A pointer to a UTF-8 string that stays valid at least until the next call to this function. If you need it around any longer, you must copy it. If the scancode doesn't have a name, this function returns "".
|
||||
*
|
||||
* \sa SDL_scancode
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_scancode
|
||||
scancode);
|
||||
|
||||
/**
|
||||
* \fn const char *SDL_GetKeyName(SDLKey key)
|
||||
*
|
||||
* \brief Get a human-readable name for a key.
|
||||
*
|
||||
* \param layoutKey An SDL layout key code.
|
||||
*
|
||||
* If what you have is a physical key code, e.g. from the \link SDL_keysym::sym key.keysym.sym \endlink field of the SDL_Event structure, convert it to a layout key code using SDL_GetLayoutKey() first. Doing this ensures that the returned name matches what users see on their keyboards. Calling this function directly on a physical key code (that is not also a layout key code) is possible, but is not recommended except for debugging purposes. The name returned in that case is the name of the \link ::SDLPhysicalKey SDLK_* \endlink constant and is not suitable for display to users.
|
||||
*
|
||||
* \return A pointer to a UTF-8 string that stays valid at least until the next call to this function. If you need it around any longer, you must copy it. Always non-NULL.
|
||||
* \return A pointer to a UTF-8 string that stays valid at least until the next call to this function. If you need it around any longer, you must copy it. If the key doesn't have a name, this function returns "".
|
||||
*
|
||||
* \sa SDLKey
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDLKey layoutKey);
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDLKey key);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
|
|
|
@ -28,413 +28,222 @@
|
|||
#define _SDL_keysym_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_scancode.h"
|
||||
|
||||
/**
|
||||
* \typedef SDLKey
|
||||
*
|
||||
* \brief The SDL virtual key representation.
|
||||
*
|
||||
* Values of this type are used to represent keyboard keys, among other places
|
||||
* in the \link SDL_keysym::sym key.keysym.sym \endlink field of the SDL_Event
|
||||
* structure.
|
||||
*
|
||||
* There are two fundamental ways of referring to a key: First, a certain code
|
||||
* can stand for a key at a specific physical location on the keyboard,
|
||||
* independent of its label or what character it generates. These are the \e
|
||||
* physical key codes, comparable to the raw hardware scancodes that a keyboard
|
||||
* generates. Second, a code can refer to a key with a specific label,
|
||||
* generating a specific character or performing a specific function, which may
|
||||
* be located at different places on the keyboard, or not exist at all,
|
||||
* depending on what keyboard layout is used. These are \e layout key codes.
|
||||
*
|
||||
* There is a certain overlap between the sets of physical key codes and layout
|
||||
* key codes: \e return, \e tab, \e ctrl etc. are typically independent of the
|
||||
* keyboard layout and can be thought of as either a physical or a layout key.
|
||||
* Therefore, rather than having separate types with separate sets of constants
|
||||
* for physical keys and layout keys, a single type ::SDLKey is used for both
|
||||
* sets. The physical key codes (forming a well-known set of a few hundred
|
||||
* elements) are enumerated in enum ::SDLPhysicalKey. The set of layout key
|
||||
* codes is more diverse: For keys that don't generate characters, the layout
|
||||
* key code is equal to the physical key code, i.e. the same SDLK_* constants
|
||||
* from enum ::SDLPhysicalKey are used. For character keys, the layout key code
|
||||
* is equal to the Unicode code point of the character that is generated when
|
||||
* the key is pressed without shift or any other modifiers (for ASCII
|
||||
* characters, this can be directly written as a character literal like
|
||||
* <tt>'x'</tt>).
|
||||
*
|
||||
* The \link SDL_keysym::sym key.keysym.sym \endlink field of the SDL_Event
|
||||
* structure is always a physical key code. To get the layout key code for the
|
||||
* event, run that physical key code through SDL_GetLayoutKey(), which converts
|
||||
* it to a layout key code according to the current keyboard layout settings of
|
||||
* the OS. In particular, this is what should be done when displaying the name
|
||||
* of a key to the user: use
|
||||
* <tt>SDL_GetKeyName(SDL_GetLayoutKey(myPhysicalKeyCode))</tt>. Do not use
|
||||
* SDL_GetKeyName() directly on a physical key code (except for debugging
|
||||
* purposes), as the name returned by that will not correspond to how the key
|
||||
* is labeled on the user's keyboard.
|
||||
*
|
||||
* \par Example:
|
||||
* To implement WASD directional keys, it makes sense to use physical key
|
||||
* codes, so that the "forward" key will be above the "backward" key even
|
||||
* though, for example, it's labeled "Z", not "W", on a French keyboard:
|
||||
* \code
|
||||
* print("To go forward, press the %s key.", SDL_GetKeyName(SDL_GetLayoutKey(SDLK_W)));
|
||||
* ...
|
||||
* switch (event.key.keysym.sym) {
|
||||
* case SDLK_W:
|
||||
* forward();
|
||||
* break;
|
||||
* case SDLK_A:
|
||||
* left();
|
||||
* break;
|
||||
* ...
|
||||
* }
|
||||
* \endcode
|
||||
* For keys based on mnemonics like "I for inventory" or "Z for zoom", use
|
||||
* layout key codes, so that the key labeled "Z" will zoom, whether it's at the
|
||||
* bottom left of the keyboard like on a US layout, or in the upper center like
|
||||
* on a German layout (but keep in mind that this forces your users to use a
|
||||
* keyboard layout where there \e is an I or Z key):
|
||||
* \code
|
||||
* print("To open the inventory, press the %s key.", SDL_GetKeyName('i'));
|
||||
* ...
|
||||
* switch (SDL_GetLayoutKey(event.key.keysym.sym)) {
|
||||
* case 'i':
|
||||
* inventory();
|
||||
* break;
|
||||
* case 'z':
|
||||
* zoom();
|
||||
* break;
|
||||
* ...
|
||||
* }
|
||||
* \endcode
|
||||
* Of course, in a real application, you should not hardcode your key
|
||||
* assignments like this, but make them user-configurable.
|
||||
* Values of this type are used to represent keyboard keys using the current
|
||||
* layout of the keyboard. These values include Unicode values representing
|
||||
* the unmodified character that would be generated by pressing the key, or
|
||||
* an SDLK_* constant for those keys that do not generate characters.
|
||||
*/
|
||||
typedef Uint32 SDLKey;
|
||||
typedef Sint32 SDLKey;
|
||||
|
||||
#define SDL_KEY_CAN_BE_PHYSICAL_BIT (1<<24) /* marks SDLKeys from the "physical" set (some of these are also in the "layout" set) */
|
||||
#define SDL_KEY_KEYPAD_BIT (1<<25) /* marks keypad keys that need [] around their name to distinguish them from the corresponding keyboard keys */
|
||||
#define SDL_KEY_LAYOUT_SPECIAL_BIT (1<<26) /* marks non-physical layout keys that cannot be described by a single character */
|
||||
#define SDLK_SCANCODE_MASK (1<<30)
|
||||
#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK)
|
||||
|
||||
/** Converts an \link ::SDLPhysicalKey SDLK_* \endlink constant to an index into the array obtained from SDL_GetKeyState(). */
|
||||
#define SDLK_INDEX(k) ((k) & 0x00FFFFFF)
|
||||
|
||||
#define SDL_PHYSICAL_KEY(n) ((n) | SDL_KEY_CAN_BE_PHYSICAL_BIT)
|
||||
|
||||
/**
|
||||
* \brief SDL physical key codes.
|
||||
*
|
||||
* This is the set of physical key codes, i.e. the values of SDL_keysym::sym.
|
||||
* Some of them (those for non-character keys) also appear as layout key codes.
|
||||
* The constants are typically named after how the key would be labeled on a US
|
||||
* keyboard, e.g. SDLK_A or SDLK_LEFTBRACKET refer to the keys used as A and [
|
||||
* on a US layout, but used as Q and ^ on a French layout.
|
||||
*
|
||||
* <em>enum SDLPhysicalKey</em> is not a useful type in its own right - the
|
||||
* constants defined here are intended as values of the ::SDLKey type. The only
|
||||
* reason for the enum to have a name at all is that otherwise it would be
|
||||
* impossible to refer to it in the documentation.
|
||||
*
|
||||
* \sa SDLKey
|
||||
*
|
||||
* \par Notes for driver implementors:
|
||||
* These constants and their numerical values are based on the USB HID usage
|
||||
* tables, version 1.12
|
||||
* <http://www.usb.org/developers/devclass_docs/Hut1_12.pdf>, section "10
|
||||
* Keyboard/Keypad Page (0x07)". When deciding what code to generate for what
|
||||
* key, the following rules can be used as guidelines:
|
||||
* - A given key on a given keyboard should produce the same SDLK_* code, no
|
||||
* matter what computer it is connected to, what OS runs on that computer, and
|
||||
* what the keyboard layout settings in the OS are. For USB keyboards, that
|
||||
* should be the code numerically corresponding to the key's USB usage code
|
||||
* (with exceptions, see comments for specific constants).
|
||||
* - Two keys on two different keyboards are considered "the same key" and
|
||||
* should generate the same SDLK_* code if, when connected to the same
|
||||
* computer, they are treated equally by the OS. For USB keyboards, that's
|
||||
* generally the case when they generate the same USB usage code. Non-USB
|
||||
* keyboards can probably be treated like USB keyboards of the same layout, if
|
||||
* such exist. If not, and there's no possibility to determine the equivalence
|
||||
* relation by transitivity from the above - in particular, on devices like
|
||||
* phones or game consoles that don't have PC-style alphabetic keyboards -
|
||||
* apply common sense. If none of the predefined codes fit, insert new ones at
|
||||
* the end.
|
||||
*/
|
||||
enum SDLPhysicalKey
|
||||
enum
|
||||
{
|
||||
SDLK_FIRST_PHYSICAL = 0, /**< (not a key, just marks the lowest used value in this enum) */
|
||||
SDLK_NONE = SDL_PHYSICAL_KEY(0),
|
||||
SDLK_UNKNOWN = SDL_PHYSICAL_KEY(1), /* Not from the USB spec, but this is a convenient place for it */
|
||||
SDLK_UNKNOWN = 0,
|
||||
|
||||
SDLK_A = SDL_PHYSICAL_KEY(4),
|
||||
SDLK_B = SDL_PHYSICAL_KEY(5),
|
||||
SDLK_C = SDL_PHYSICAL_KEY(6),
|
||||
SDLK_D = SDL_PHYSICAL_KEY(7),
|
||||
SDLK_E = SDL_PHYSICAL_KEY(8),
|
||||
SDLK_F = SDL_PHYSICAL_KEY(9),
|
||||
SDLK_G = SDL_PHYSICAL_KEY(10),
|
||||
SDLK_H = SDL_PHYSICAL_KEY(11),
|
||||
SDLK_I = SDL_PHYSICAL_KEY(12),
|
||||
SDLK_J = SDL_PHYSICAL_KEY(13),
|
||||
SDLK_K = SDL_PHYSICAL_KEY(14),
|
||||
SDLK_L = SDL_PHYSICAL_KEY(15),
|
||||
SDLK_M = SDL_PHYSICAL_KEY(16),
|
||||
SDLK_N = SDL_PHYSICAL_KEY(17),
|
||||
SDLK_O = SDL_PHYSICAL_KEY(18),
|
||||
SDLK_P = SDL_PHYSICAL_KEY(19),
|
||||
SDLK_Q = SDL_PHYSICAL_KEY(20),
|
||||
SDLK_R = SDL_PHYSICAL_KEY(21),
|
||||
SDLK_S = SDL_PHYSICAL_KEY(22),
|
||||
SDLK_T = SDL_PHYSICAL_KEY(23),
|
||||
SDLK_U = SDL_PHYSICAL_KEY(24),
|
||||
SDLK_V = SDL_PHYSICAL_KEY(25),
|
||||
SDLK_W = SDL_PHYSICAL_KEY(26),
|
||||
SDLK_X = SDL_PHYSICAL_KEY(27),
|
||||
SDLK_Y = SDL_PHYSICAL_KEY(28),
|
||||
SDLK_Z = SDL_PHYSICAL_KEY(29),
|
||||
SDLK_RETURN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN),
|
||||
SDLK_ESCAPE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ESCAPE),
|
||||
SDLK_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BACKSPACE),
|
||||
SDLK_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_TAB),
|
||||
SDLK_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SPACE),
|
||||
|
||||
SDLK_1 = SDL_PHYSICAL_KEY(30),
|
||||
SDLK_2 = SDL_PHYSICAL_KEY(31),
|
||||
SDLK_3 = SDL_PHYSICAL_KEY(32),
|
||||
SDLK_4 = SDL_PHYSICAL_KEY(33),
|
||||
SDLK_5 = SDL_PHYSICAL_KEY(34),
|
||||
SDLK_6 = SDL_PHYSICAL_KEY(35),
|
||||
SDLK_7 = SDL_PHYSICAL_KEY(36),
|
||||
SDLK_8 = SDL_PHYSICAL_KEY(37),
|
||||
SDLK_9 = SDL_PHYSICAL_KEY(38),
|
||||
SDLK_0 = SDL_PHYSICAL_KEY(39),
|
||||
SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK),
|
||||
|
||||
SDLK_RETURN = SDL_PHYSICAL_KEY(40),
|
||||
SDLK_ESCAPE = SDL_PHYSICAL_KEY(41),
|
||||
SDLK_BACKSPACE = SDL_PHYSICAL_KEY(42),
|
||||
SDLK_TAB = SDL_PHYSICAL_KEY(43),
|
||||
SDLK_SPACE = SDL_PHYSICAL_KEY(44),
|
||||
SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1),
|
||||
SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2),
|
||||
SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3),
|
||||
SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4),
|
||||
SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5),
|
||||
SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6),
|
||||
SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7),
|
||||
SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8),
|
||||
SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9),
|
||||
SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10),
|
||||
SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11),
|
||||
SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12),
|
||||
|
||||
SDLK_HYPHENMINUS = SDL_PHYSICAL_KEY(45),
|
||||
SDLK_EQUALS = SDL_PHYSICAL_KEY(46),
|
||||
SDLK_LEFTBRACKET = SDL_PHYSICAL_KEY(47),
|
||||
SDLK_RIGHTBRACKET = SDL_PHYSICAL_KEY(48),
|
||||
SDLK_BACKSLASH = SDL_PHYSICAL_KEY(49), /**< Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. */
|
||||
SDLK_NONUSHASH = SDL_PHYSICAL_KEY(50), /**< ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDLK_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. */
|
||||
SDLK_SEMICOLON = SDL_PHYSICAL_KEY(51),
|
||||
SDLK_APOSTROPHE = SDL_PHYSICAL_KEY(52),
|
||||
SDLK_GRAVE = SDL_PHYSICAL_KEY(53), /**< Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. */
|
||||
SDLK_COMMA = SDL_PHYSICAL_KEY(54),
|
||||
SDLK_PERIOD = SDL_PHYSICAL_KEY(55),
|
||||
SDLK_SLASH = SDL_PHYSICAL_KEY(56),
|
||||
SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN),
|
||||
SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK),
|
||||
SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE),
|
||||
SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT),
|
||||
SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME),
|
||||
SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP),
|
||||
SDLK_DELETE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DELETE),
|
||||
SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END),
|
||||
SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN),
|
||||
SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT),
|
||||
SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT),
|
||||
SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN),
|
||||
SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP),
|
||||
|
||||
SDLK_CAPSLOCK = SDL_PHYSICAL_KEY(57),
|
||||
SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR),
|
||||
SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE),
|
||||
SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY),
|
||||
SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS),
|
||||
SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS),
|
||||
SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER),
|
||||
SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1),
|
||||
SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2),
|
||||
SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3),
|
||||
SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4),
|
||||
SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5),
|
||||
SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6),
|
||||
SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7),
|
||||
SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8),
|
||||
SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9),
|
||||
SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0),
|
||||
SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD),
|
||||
|
||||
SDLK_F1 = SDL_PHYSICAL_KEY(58),
|
||||
SDLK_F2 = SDL_PHYSICAL_KEY(59),
|
||||
SDLK_F3 = SDL_PHYSICAL_KEY(60),
|
||||
SDLK_F4 = SDL_PHYSICAL_KEY(61),
|
||||
SDLK_F5 = SDL_PHYSICAL_KEY(62),
|
||||
SDLK_F6 = SDL_PHYSICAL_KEY(63),
|
||||
SDLK_F7 = SDL_PHYSICAL_KEY(64),
|
||||
SDLK_F8 = SDL_PHYSICAL_KEY(65),
|
||||
SDLK_F9 = SDL_PHYSICAL_KEY(66),
|
||||
SDLK_F10 = SDL_PHYSICAL_KEY(67),
|
||||
SDLK_F11 = SDL_PHYSICAL_KEY(68),
|
||||
SDLK_F12 = SDL_PHYSICAL_KEY(69),
|
||||
SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION),
|
||||
SDLK_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER),
|
||||
SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS),
|
||||
SDLK_F13 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13),
|
||||
SDLK_F14 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14),
|
||||
SDLK_F15 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15),
|
||||
SDLK_F16 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16),
|
||||
SDLK_F17 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17),
|
||||
SDLK_F18 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18),
|
||||
SDLK_F19 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19),
|
||||
SDLK_F20 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20),
|
||||
SDLK_F21 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21),
|
||||
SDLK_F22 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22),
|
||||
SDLK_F23 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23),
|
||||
SDLK_F24 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24),
|
||||
SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE),
|
||||
SDLK_HELP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP),
|
||||
SDLK_MENU = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU),
|
||||
SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT),
|
||||
SDLK_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP),
|
||||
SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN),
|
||||
SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO),
|
||||
SDLK_CUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT),
|
||||
SDLK_COPY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY),
|
||||
SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE),
|
||||
SDLK_FIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND),
|
||||
SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE),
|
||||
SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP),
|
||||
SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN),
|
||||
SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA),
|
||||
SDLK_KP_EQUALSAS400 =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400),
|
||||
|
||||
SDLK_PRINTSCREEN = SDL_PHYSICAL_KEY(70),
|
||||
SDLK_SCROLLLOCK = SDL_PHYSICAL_KEY(71),
|
||||
SDLK_PAUSE = SDL_PHYSICAL_KEY(72),
|
||||
SDLK_INSERT = SDL_PHYSICAL_KEY(73), /**< insert on PC, help on some Mac keyboards (but does send code 73, not 117) */
|
||||
SDLK_HOME = SDL_PHYSICAL_KEY(74),
|
||||
SDLK_PAGEUP = SDL_PHYSICAL_KEY(75),
|
||||
SDLK_DELETE = SDL_PHYSICAL_KEY(76),
|
||||
SDLK_END = SDL_PHYSICAL_KEY(77),
|
||||
SDLK_PAGEDOWN = SDL_PHYSICAL_KEY(78),
|
||||
SDLK_RIGHT = SDL_PHYSICAL_KEY(79),
|
||||
SDLK_LEFT = SDL_PHYSICAL_KEY(80),
|
||||
SDLK_DOWN = SDL_PHYSICAL_KEY(81),
|
||||
SDLK_UP = SDL_PHYSICAL_KEY(82),
|
||||
SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE),
|
||||
SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ),
|
||||
SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL),
|
||||
SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR),
|
||||
SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR),
|
||||
SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2),
|
||||
SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR),
|
||||
SDLK_OUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT),
|
||||
SDLK_OPER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER),
|
||||
SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN),
|
||||
SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL),
|
||||
SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL),
|
||||
|
||||
SDLK_KP_NUMLOCKCLEAR = SDL_PHYSICAL_KEY(83), /**< num lock on PC, clear on Mac keyboards */
|
||||
SDLK_KP_DIVIDE = SDL_PHYSICAL_KEY(84) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_MULTIPLY = SDL_PHYSICAL_KEY(85) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_MINUS = SDL_PHYSICAL_KEY(86) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_PLUS = SDL_PHYSICAL_KEY(87) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_ENTER = SDL_PHYSICAL_KEY(88),
|
||||
SDLK_KP_1 = SDL_PHYSICAL_KEY(89) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_2 = SDL_PHYSICAL_KEY(90) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_3 = SDL_PHYSICAL_KEY(91) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_4 = SDL_PHYSICAL_KEY(92) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_5 = SDL_PHYSICAL_KEY(93) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_6 = SDL_PHYSICAL_KEY(94) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_7 = SDL_PHYSICAL_KEY(95) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_8 = SDL_PHYSICAL_KEY(96) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_9 = SDL_PHYSICAL_KEY(97) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_0 = SDL_PHYSICAL_KEY(98) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_PERIOD = SDL_PHYSICAL_KEY(99) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00),
|
||||
SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000),
|
||||
SDLK_THOUSANDSSEPARATOR =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR),
|
||||
SDLK_DECIMALSEPARATOR =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR),
|
||||
SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT),
|
||||
SDLK_CURRENCYSUBUNIT =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT),
|
||||
SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN),
|
||||
SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN),
|
||||
SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE),
|
||||
SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE),
|
||||
SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB),
|
||||
SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE),
|
||||
SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A),
|
||||
SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B),
|
||||
SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C),
|
||||
SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D),
|
||||
SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E),
|
||||
SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F),
|
||||
SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR),
|
||||
SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER),
|
||||
SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT),
|
||||
SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS),
|
||||
SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER),
|
||||
SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND),
|
||||
SDLK_KP_DBLAMPERSAND =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND),
|
||||
SDLK_KP_VERTICALBAR =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR),
|
||||
SDLK_KP_DBLVERTICALBAR =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR),
|
||||
SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON),
|
||||
SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH),
|
||||
SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE),
|
||||
SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT),
|
||||
SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM),
|
||||
SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE),
|
||||
SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL),
|
||||
SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR),
|
||||
SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD),
|
||||
SDLK_KP_MEMSUBTRACT =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT),
|
||||
SDLK_KP_MEMMULTIPLY =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY),
|
||||
SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE),
|
||||
SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS),
|
||||
SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR),
|
||||
SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY),
|
||||
SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY),
|
||||
SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL),
|
||||
SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL),
|
||||
SDLK_KP_HEXADECIMAL =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL),
|
||||
|
||||
SDLK_NONUSBACKSLASH = SDL_PHYSICAL_KEY(100), /**< This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. */
|
||||
SDLK_APPLICATION = SDL_PHYSICAL_KEY(101), /**< windows contextual menu, compose */
|
||||
SDLK_POWER = SDL_PHYSICAL_KEY(102), /**< The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. */
|
||||
SDLK_KP_EQUALS = SDL_PHYSICAL_KEY(103) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_F13 = SDL_PHYSICAL_KEY(104),
|
||||
SDLK_F14 = SDL_PHYSICAL_KEY(105),
|
||||
SDLK_F15 = SDL_PHYSICAL_KEY(106),
|
||||
SDLK_F16 = SDL_PHYSICAL_KEY(107),
|
||||
SDLK_F17 = SDL_PHYSICAL_KEY(108),
|
||||
SDLK_F18 = SDL_PHYSICAL_KEY(109),
|
||||
SDLK_F19 = SDL_PHYSICAL_KEY(110),
|
||||
SDLK_F20 = SDL_PHYSICAL_KEY(111),
|
||||
SDLK_F21 = SDL_PHYSICAL_KEY(112),
|
||||
SDLK_F22 = SDL_PHYSICAL_KEY(113),
|
||||
SDLK_F23 = SDL_PHYSICAL_KEY(114),
|
||||
SDLK_F24 = SDL_PHYSICAL_KEY(115),
|
||||
SDLK_EXECUTE = SDL_PHYSICAL_KEY(116),
|
||||
SDLK_HELP = SDL_PHYSICAL_KEY(117),
|
||||
SDLK_MENU = SDL_PHYSICAL_KEY(118),
|
||||
SDLK_SELECT = SDL_PHYSICAL_KEY(119),
|
||||
SDLK_STOP = SDL_PHYSICAL_KEY(120),
|
||||
SDLK_AGAIN = SDL_PHYSICAL_KEY(121), /*!< redo */
|
||||
SDLK_UNDO = SDL_PHYSICAL_KEY(122),
|
||||
SDLK_CUT = SDL_PHYSICAL_KEY(123),
|
||||
SDLK_COPY = SDL_PHYSICAL_KEY(124),
|
||||
SDLK_PASTE = SDL_PHYSICAL_KEY(125),
|
||||
SDLK_FIND = SDL_PHYSICAL_KEY(126),
|
||||
SDLK_MUTE = SDL_PHYSICAL_KEY(127),
|
||||
SDLK_VOLUMEUP = SDL_PHYSICAL_KEY(128),
|
||||
SDLK_VOLUMEDOWN = SDL_PHYSICAL_KEY(129),
|
||||
/* not sure whether there's a reason to enable these */
|
||||
/* SDLK_LOCKINGCAPSLOCK = SDL_PHYSICAL_KEY(130), */
|
||||
/* SDLK_LOCKINGNUMLOCK = SDL_PHYSICAL_KEY(131), */
|
||||
/* SDLK_LOCKINGSCROLLLOCK = SDL_PHYSICAL_KEY(132), */
|
||||
SDLK_KP_COMMA = SDL_PHYSICAL_KEY(133) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_EQUALSAS400 = SDL_PHYSICAL_KEY(134) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL),
|
||||
SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT),
|
||||
SDLK_LALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT),
|
||||
SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI),
|
||||
SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL),
|
||||
SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT),
|
||||
SDLK_RALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT),
|
||||
SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI),
|
||||
|
||||
SDLK_INTERNATIONAL1 = SDL_PHYSICAL_KEY(135), /**< used on Asian keyboards, see footnotes in USB doc */
|
||||
SDLK_INTERNATIONAL2 = SDL_PHYSICAL_KEY(136),
|
||||
SDLK_INTERNATIONAL3 = SDL_PHYSICAL_KEY(137), /**< Yen */
|
||||
SDLK_INTERNATIONAL4 = SDL_PHYSICAL_KEY(138),
|
||||
SDLK_INTERNATIONAL5 = SDL_PHYSICAL_KEY(139),
|
||||
SDLK_INTERNATIONAL6 = SDL_PHYSICAL_KEY(140),
|
||||
SDLK_INTERNATIONAL7 = SDL_PHYSICAL_KEY(141),
|
||||
SDLK_INTERNATIONAL8 = SDL_PHYSICAL_KEY(142),
|
||||
SDLK_INTERNATIONAL9 = SDL_PHYSICAL_KEY(143),
|
||||
SDLK_LANG1 = SDL_PHYSICAL_KEY(144), /**< Hangul/English toggle */
|
||||
SDLK_LANG2 = SDL_PHYSICAL_KEY(145), /**< Hanja conversion */
|
||||
SDLK_LANG3 = SDL_PHYSICAL_KEY(146), /**< Katakana */
|
||||
SDLK_LANG4 = SDL_PHYSICAL_KEY(147), /**< Hiragana */
|
||||
SDLK_LANG5 = SDL_PHYSICAL_KEY(148), /**< Zenkaku/Hankaku */
|
||||
SDLK_LANG6 = SDL_PHYSICAL_KEY(149), /**< reserved */
|
||||
SDLK_LANG7 = SDL_PHYSICAL_KEY(150), /**< reserved */
|
||||
SDLK_LANG8 = SDL_PHYSICAL_KEY(151), /**< reserved */
|
||||
SDLK_LANG9 = SDL_PHYSICAL_KEY(152), /**< reserved */
|
||||
SDLK_MODE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE),
|
||||
|
||||
SDLK_ALTERASE = SDL_PHYSICAL_KEY(153), /**< Erase-Eaze */
|
||||
SDLK_SYSREQ = SDL_PHYSICAL_KEY(154),
|
||||
SDLK_CANCEL = SDL_PHYSICAL_KEY(155),
|
||||
SDLK_CLEAR = SDL_PHYSICAL_KEY(156),
|
||||
SDLK_PRIOR = SDL_PHYSICAL_KEY(157),
|
||||
SDLK_RETURN2 = SDL_PHYSICAL_KEY(158),
|
||||
SDLK_SEPARATOR = SDL_PHYSICAL_KEY(159),
|
||||
SDLK_OUT = SDL_PHYSICAL_KEY(160),
|
||||
SDLK_OPER = SDL_PHYSICAL_KEY(161),
|
||||
SDLK_CLEARAGAIN = SDL_PHYSICAL_KEY(162),
|
||||
SDLK_CRSELPROPS = SDL_PHYSICAL_KEY(163),
|
||||
SDLK_EXSEL = SDL_PHYSICAL_KEY(164),
|
||||
SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT),
|
||||
SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV),
|
||||
SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP),
|
||||
SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY),
|
||||
SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE),
|
||||
SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT),
|
||||
SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL),
|
||||
SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR),
|
||||
SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER),
|
||||
SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH),
|
||||
SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME),
|
||||
SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK),
|
||||
SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD),
|
||||
SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP),
|
||||
SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH),
|
||||
SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS),
|
||||
|
||||
SDLK_KP_00 = SDL_PHYSICAL_KEY(176) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_000 = SDL_PHYSICAL_KEY(177) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_THOUSANDSSEPARATOR = SDL_PHYSICAL_KEY(178),
|
||||
SDLK_DECIMALSEPARATOR = SDL_PHYSICAL_KEY(179),
|
||||
SDLK_CURRENCYUNIT = SDL_PHYSICAL_KEY(180),
|
||||
SDLK_CURRENCYSUBUNIT = SDL_PHYSICAL_KEY(181),
|
||||
SDLK_KP_LEFTPAREN = SDL_PHYSICAL_KEY(182) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_RIGHTPAREN = SDL_PHYSICAL_KEY(183) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_LEFTBRACE = SDL_PHYSICAL_KEY(184) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_RIGHTBRACE = SDL_PHYSICAL_KEY(185) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_TAB = SDL_PHYSICAL_KEY(186) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_BACKSPACE = SDL_PHYSICAL_KEY(187) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_A = SDL_PHYSICAL_KEY(188) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_B = SDL_PHYSICAL_KEY(189) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_C = SDL_PHYSICAL_KEY(190) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_D = SDL_PHYSICAL_KEY(191) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_E = SDL_PHYSICAL_KEY(192) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_F = SDL_PHYSICAL_KEY(193) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_XOR = SDL_PHYSICAL_KEY(194) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_POWER = SDL_PHYSICAL_KEY(195) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_PERCENT = SDL_PHYSICAL_KEY(196) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_LESS = SDL_PHYSICAL_KEY(197) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_GREATER = SDL_PHYSICAL_KEY(198) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_AMPERSAND = SDL_PHYSICAL_KEY(199) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_DBLAMPERSAND = SDL_PHYSICAL_KEY(200) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_VERTICALBAR = SDL_PHYSICAL_KEY(201) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_DBLVERTICALBAR = SDL_PHYSICAL_KEY(202) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_COLON = SDL_PHYSICAL_KEY(203) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_HASH = SDL_PHYSICAL_KEY(204) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_SPACE = SDL_PHYSICAL_KEY(205) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_AT = SDL_PHYSICAL_KEY(206) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_EXCLAM = SDL_PHYSICAL_KEY(207) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_MEMSTORE = SDL_PHYSICAL_KEY(208) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_MEMRECALL = SDL_PHYSICAL_KEY(209) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_MEMCLEAR = SDL_PHYSICAL_KEY(210) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_MEMADD = SDL_PHYSICAL_KEY(211) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_MEMSUBTRACT = SDL_PHYSICAL_KEY(212) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_MEMMULTIPLY = SDL_PHYSICAL_KEY(213) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_MEMDIVIDE = SDL_PHYSICAL_KEY(214) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_PLUSMINUS = SDL_PHYSICAL_KEY(215) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_CLEAR = SDL_PHYSICAL_KEY(216) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_CLEARENTRY = SDL_PHYSICAL_KEY(217) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_BINARY = SDL_PHYSICAL_KEY(218) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_OCTAL = SDL_PHYSICAL_KEY(219) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_DECIMAL = SDL_PHYSICAL_KEY(220) | SDL_KEY_KEYPAD_BIT,
|
||||
SDLK_KP_HEXADECIMAL = SDL_PHYSICAL_KEY(221) | SDL_KEY_KEYPAD_BIT,
|
||||
|
||||
SDLK_LCTRL = SDL_PHYSICAL_KEY(224),
|
||||
SDLK_LSHIFT = SDL_PHYSICAL_KEY(225),
|
||||
SDLK_LALT = SDL_PHYSICAL_KEY(226), /**< alt, option */
|
||||
SDLK_LMETA = SDL_PHYSICAL_KEY(227), /**< windows, command (apple), meta */
|
||||
SDLK_RCTRL = SDL_PHYSICAL_KEY(228),
|
||||
SDLK_RSHIFT = SDL_PHYSICAL_KEY(229),
|
||||
SDLK_RALT = SDL_PHYSICAL_KEY(230), /**< alt gr, option */
|
||||
SDLK_RMETA = SDL_PHYSICAL_KEY(231), /**< windows, command (apple), meta */
|
||||
|
||||
/* Everything below here is not from the USB spec */
|
||||
|
||||
SDLK_MODE = SDL_PHYSICAL_KEY(232), /* I'm not sure if this is really not covered by any of the above, but since there's a special KMOD_MODE for it I'm adding it here */
|
||||
|
||||
SDLK_BRIGHTNESSDOWN = SDL_PHYSICAL_KEY(236),
|
||||
SDLK_BRIGHTNESSUP = SDL_PHYSICAL_KEY(237),
|
||||
SDLK_DISPLAYSWITCH = SDL_PHYSICAL_KEY(238), /**< display mirroring/dual display switch, video mode switch */
|
||||
SDLK_KBDILLUMTOGGLE = SDL_PHYSICAL_KEY(239),
|
||||
SDLK_KBDILLUMDOWN = SDL_PHYSICAL_KEY(240),
|
||||
SDLK_KBDILLUMUP = SDL_PHYSICAL_KEY(241),
|
||||
SDLK_EJECT = SDL_PHYSICAL_KEY(242),
|
||||
SDLK_SLEEP = SDL_PHYSICAL_KEY(243),
|
||||
|
||||
/* Some of the more common and more standardized "multimedia"/"internet" keyboard keys */
|
||||
SDLK_AUDIOPLAY = SDL_PHYSICAL_KEY(244),
|
||||
SDLK_AUDIOSTOP = SDL_PHYSICAL_KEY(245),
|
||||
SDLK_AUDIOPREV = SDL_PHYSICAL_KEY(246),
|
||||
SDLK_AUDIONEXT = SDL_PHYSICAL_KEY(247),
|
||||
SDLK_CALC = SDL_PHYSICAL_KEY(248),
|
||||
SDLK_WWW = SDL_PHYSICAL_KEY(249),
|
||||
SDLK_EMAIL = SDL_PHYSICAL_KEY(250),
|
||||
SDLK_MEDIA = SDL_PHYSICAL_KEY(251),
|
||||
SDLK_COMPUTER = SDL_PHYSICAL_KEY(252),
|
||||
SDLK_SEARCH = SDL_PHYSICAL_KEY(253),
|
||||
SDLK_BOOKMARKS = SDL_PHYSICAL_KEY(254),
|
||||
SDLK_BROWSERBACK = SDL_PHYSICAL_KEY(255),
|
||||
SDLK_BROWSERFORWARD = SDL_PHYSICAL_KEY(256),
|
||||
SDLK_BROWSERRELOAD = SDL_PHYSICAL_KEY(257),
|
||||
SDLK_BROWSERSTOP = SDL_PHYSICAL_KEY(258),
|
||||
|
||||
/* Add any other keys here */
|
||||
|
||||
SDLK_LAST_PHYSICAL /**< (not a key, just marks the highest used value in this enum) */
|
||||
SDLK_BRIGHTNESSDOWN =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN),
|
||||
SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP),
|
||||
SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH),
|
||||
SDLK_KBDILLUMTOGGLE =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE),
|
||||
SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN),
|
||||
SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP),
|
||||
SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT),
|
||||
SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP),
|
||||
};
|
||||
|
||||
#define SDLK_FIRST SDLK_INDEX(SDLK_FIRST_PHYSICAL)
|
||||
#define SDLK_LAST SDLK_INDEX(SDLK_LAST_PHYSICAL)
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \enum SDLMod
|
||||
*
|
||||
|
@ -449,8 +258,8 @@ typedef enum
|
|||
KMOD_RCTRL = 0x0080,
|
||||
KMOD_LALT = 0x0100,
|
||||
KMOD_RALT = 0x0200,
|
||||
KMOD_LMETA = 0x0400,
|
||||
KMOD_RMETA = 0x0800,
|
||||
KMOD_LGUI = 0x0400,
|
||||
KMOD_RGUI = 0x0800,
|
||||
KMOD_NUM = 0x1000,
|
||||
KMOD_CAPS = 0x2000,
|
||||
KMOD_MODE = 0x4000,
|
||||
|
@ -460,6 +269,8 @@ typedef enum
|
|||
#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
|
||||
#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
|
||||
#define KMOD_ALT (KMOD_LALT|KMOD_RALT)
|
||||
#define KMOD_META (KMOD_LMETA|KMOD_RMETA)
|
||||
#define KMOD_GUI (KMOD_LGUI|KMOD_RGUI)
|
||||
|
||||
#endif /* _SDL_keysym_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
318
include/SDL_scancode.h
Normal file
318
include/SDL_scancode.h
Normal file
|
@ -0,0 +1,318 @@
|
|||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_scancode.h
|
||||
*/
|
||||
|
||||
#ifndef _SDL_scancode_h
|
||||
#define _SDL_scancode_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
/**
|
||||
* \enum SDL_scancode
|
||||
*
|
||||
* \brief The SDL keyboard scancode representation.
|
||||
*
|
||||
* Values of this type are used to represent keyboard keys, among other places
|
||||
* in the \link SDL_keysym::scancode key.keysym.scancode \endlink field of the
|
||||
* SDL_Event structure.
|
||||
*
|
||||
* The values in this enumeration are based on the USB usage page standard:
|
||||
* http://www.usb.org/developers/devclass_docs/Hut1_12.pdf
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_SCANCODE_UNKNOWN = 0,
|
||||
|
||||
/* These values are from usage page 0x07 (USB keyboard page) */
|
||||
|
||||
SDL_SCANCODE_A = 4,
|
||||
SDL_SCANCODE_B = 5,
|
||||
SDL_SCANCODE_C = 6,
|
||||
SDL_SCANCODE_D = 7,
|
||||
SDL_SCANCODE_E = 8,
|
||||
SDL_SCANCODE_F = 9,
|
||||
SDL_SCANCODE_G = 10,
|
||||
SDL_SCANCODE_H = 11,
|
||||
SDL_SCANCODE_I = 12,
|
||||
SDL_SCANCODE_J = 13,
|
||||
SDL_SCANCODE_K = 14,
|
||||
SDL_SCANCODE_L = 15,
|
||||
SDL_SCANCODE_M = 16,
|
||||
SDL_SCANCODE_N = 17,
|
||||
SDL_SCANCODE_O = 18,
|
||||
SDL_SCANCODE_P = 19,
|
||||
SDL_SCANCODE_Q = 20,
|
||||
SDL_SCANCODE_R = 21,
|
||||
SDL_SCANCODE_S = 22,
|
||||
SDL_SCANCODE_T = 23,
|
||||
SDL_SCANCODE_U = 24,
|
||||
SDL_SCANCODE_V = 25,
|
||||
SDL_SCANCODE_W = 26,
|
||||
SDL_SCANCODE_X = 27,
|
||||
SDL_SCANCODE_Y = 28,
|
||||
SDL_SCANCODE_Z = 29,
|
||||
|
||||
SDL_SCANCODE_1 = 30,
|
||||
SDL_SCANCODE_2 = 31,
|
||||
SDL_SCANCODE_3 = 32,
|
||||
SDL_SCANCODE_4 = 33,
|
||||
SDL_SCANCODE_5 = 34,
|
||||
SDL_SCANCODE_6 = 35,
|
||||
SDL_SCANCODE_7 = 36,
|
||||
SDL_SCANCODE_8 = 37,
|
||||
SDL_SCANCODE_9 = 38,
|
||||
SDL_SCANCODE_0 = 39,
|
||||
|
||||
SDL_SCANCODE_RETURN = 40,
|
||||
SDL_SCANCODE_ESCAPE = 41,
|
||||
SDL_SCANCODE_BACKSPACE = 42,
|
||||
SDL_SCANCODE_TAB = 43,
|
||||
SDL_SCANCODE_SPACE = 44,
|
||||
|
||||
SDL_SCANCODE_HYPHENMINUS = 45,
|
||||
SDL_SCANCODE_EQUALS = 46,
|
||||
SDL_SCANCODE_LEFTBRACKET = 47,
|
||||
SDL_SCANCODE_RIGHTBRACKET = 48,
|
||||
SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. */
|
||||
SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. */
|
||||
SDL_SCANCODE_SEMICOLON = 51,
|
||||
SDL_SCANCODE_APOSTROPHE = 52,
|
||||
SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. */
|
||||
SDL_SCANCODE_COMMA = 54,
|
||||
SDL_SCANCODE_PERIOD = 55,
|
||||
SDL_SCANCODE_SLASH = 56,
|
||||
|
||||
SDL_SCANCODE_CAPSLOCK = 57,
|
||||
|
||||
SDL_SCANCODE_F1 = 58,
|
||||
SDL_SCANCODE_F2 = 59,
|
||||
SDL_SCANCODE_F3 = 60,
|
||||
SDL_SCANCODE_F4 = 61,
|
||||
SDL_SCANCODE_F5 = 62,
|
||||
SDL_SCANCODE_F6 = 63,
|
||||
SDL_SCANCODE_F7 = 64,
|
||||
SDL_SCANCODE_F8 = 65,
|
||||
SDL_SCANCODE_F9 = 66,
|
||||
SDL_SCANCODE_F10 = 67,
|
||||
SDL_SCANCODE_F11 = 68,
|
||||
SDL_SCANCODE_F12 = 69,
|
||||
|
||||
SDL_SCANCODE_PRINTSCREEN = 70,
|
||||
SDL_SCANCODE_SCROLLLOCK = 71,
|
||||
SDL_SCANCODE_PAUSE = 72,
|
||||
SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but does send code 73, not 117) */
|
||||
SDL_SCANCODE_HOME = 74,
|
||||
SDL_SCANCODE_PAGEUP = 75,
|
||||
SDL_SCANCODE_DELETE = 76,
|
||||
SDL_SCANCODE_END = 77,
|
||||
SDL_SCANCODE_PAGEDOWN = 78,
|
||||
SDL_SCANCODE_RIGHT = 79,
|
||||
SDL_SCANCODE_LEFT = 80,
|
||||
SDL_SCANCODE_DOWN = 81,
|
||||
SDL_SCANCODE_UP = 82,
|
||||
|
||||
SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards */
|
||||
SDL_SCANCODE_KP_DIVIDE = 84,
|
||||
SDL_SCANCODE_KP_MULTIPLY = 85,
|
||||
SDL_SCANCODE_KP_MINUS = 86,
|
||||
SDL_SCANCODE_KP_PLUS = 87,
|
||||
SDL_SCANCODE_KP_ENTER = 88,
|
||||
SDL_SCANCODE_KP_1 = 89,
|
||||
SDL_SCANCODE_KP_2 = 90,
|
||||
SDL_SCANCODE_KP_3 = 91,
|
||||
SDL_SCANCODE_KP_4 = 92,
|
||||
SDL_SCANCODE_KP_5 = 93,
|
||||
SDL_SCANCODE_KP_6 = 94,
|
||||
SDL_SCANCODE_KP_7 = 95,
|
||||
SDL_SCANCODE_KP_8 = 96,
|
||||
SDL_SCANCODE_KP_9 = 97,
|
||||
SDL_SCANCODE_KP_0 = 98,
|
||||
SDL_SCANCODE_KP_PERIOD = 99,
|
||||
|
||||
SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. */
|
||||
SDL_SCANCODE_APPLICATION = 101, /**< windows contextual menu, compose */
|
||||
SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. */
|
||||
SDL_SCANCODE_KP_EQUALS = 103,
|
||||
SDL_SCANCODE_F13 = 104,
|
||||
SDL_SCANCODE_F14 = 105,
|
||||
SDL_SCANCODE_F15 = 106,
|
||||
SDL_SCANCODE_F16 = 107,
|
||||
SDL_SCANCODE_F17 = 108,
|
||||
SDL_SCANCODE_F18 = 109,
|
||||
SDL_SCANCODE_F19 = 110,
|
||||
SDL_SCANCODE_F20 = 111,
|
||||
SDL_SCANCODE_F21 = 112,
|
||||
SDL_SCANCODE_F22 = 113,
|
||||
SDL_SCANCODE_F23 = 114,
|
||||
SDL_SCANCODE_F24 = 115,
|
||||
SDL_SCANCODE_EXECUTE = 116,
|
||||
SDL_SCANCODE_HELP = 117,
|
||||
SDL_SCANCODE_MENU = 118,
|
||||
SDL_SCANCODE_SELECT = 119,
|
||||
SDL_SCANCODE_STOP = 120,
|
||||
SDL_SCANCODE_AGAIN = 121, /*!< redo */
|
||||
SDL_SCANCODE_UNDO = 122,
|
||||
SDL_SCANCODE_CUT = 123,
|
||||
SDL_SCANCODE_COPY = 124,
|
||||
SDL_SCANCODE_PASTE = 125,
|
||||
SDL_SCANCODE_FIND = 126,
|
||||
SDL_SCANCODE_MUTE = 127,
|
||||
SDL_SCANCODE_VOLUMEUP = 128,
|
||||
SDL_SCANCODE_VOLUMEDOWN = 129,
|
||||
/* not sure whether there's a reason to enable these */
|
||||
/* SDL_SCANCODE_LOCKINGCAPSLOCK = 130, */
|
||||
/* SDL_SCANCODE_LOCKINGNUMLOCK = 131, */
|
||||
/* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */
|
||||
SDL_SCANCODE_KP_COMMA = 133,
|
||||
SDL_SCANCODE_KP_EQUALSAS400 = 134,
|
||||
|
||||
SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see footnotes in USB doc */
|
||||
SDL_SCANCODE_INTERNATIONAL2 = 136,
|
||||
SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */
|
||||
SDL_SCANCODE_INTERNATIONAL4 = 138,
|
||||
SDL_SCANCODE_INTERNATIONAL5 = 139,
|
||||
SDL_SCANCODE_INTERNATIONAL6 = 140,
|
||||
SDL_SCANCODE_INTERNATIONAL7 = 141,
|
||||
SDL_SCANCODE_INTERNATIONAL8 = 142,
|
||||
SDL_SCANCODE_INTERNATIONAL9 = 143,
|
||||
SDL_SCANCODE_LANG1 = 144, /**< Hangul/English toggle */
|
||||
SDL_SCANCODE_LANG2 = 145, /**< Hanja conversion */
|
||||
SDL_SCANCODE_LANG3 = 146, /**< Katakana */
|
||||
SDL_SCANCODE_LANG4 = 147, /**< Hiragana */
|
||||
SDL_SCANCODE_LANG5 = 148, /**< Zenkaku/Hankaku */
|
||||
SDL_SCANCODE_LANG6 = 149, /**< reserved */
|
||||
SDL_SCANCODE_LANG7 = 150, /**< reserved */
|
||||
SDL_SCANCODE_LANG8 = 151, /**< reserved */
|
||||
SDL_SCANCODE_LANG9 = 152, /**< reserved */
|
||||
|
||||
SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */
|
||||
SDL_SCANCODE_SYSREQ = 154,
|
||||
SDL_SCANCODE_CANCEL = 155,
|
||||
SDL_SCANCODE_CLEAR = 156,
|
||||
SDL_SCANCODE_PRIOR = 157,
|
||||
SDL_SCANCODE_RETURN2 = 158,
|
||||
SDL_SCANCODE_SEPARATOR = 159,
|
||||
SDL_SCANCODE_OUT = 160,
|
||||
SDL_SCANCODE_OPER = 161,
|
||||
SDL_SCANCODE_CLEARAGAIN = 162,
|
||||
SDL_SCANCODE_CRSEL = 163,
|
||||
SDL_SCANCODE_EXSEL = 164,
|
||||
|
||||
SDL_SCANCODE_KP_00 = 176,
|
||||
SDL_SCANCODE_KP_000 = 177,
|
||||
SDL_SCANCODE_THOUSANDSSEPARATOR = 178,
|
||||
SDL_SCANCODE_DECIMALSEPARATOR = 179,
|
||||
SDL_SCANCODE_CURRENCYUNIT = 180,
|
||||
SDL_SCANCODE_CURRENCYSUBUNIT = 181,
|
||||
SDL_SCANCODE_KP_LEFTPAREN = 182,
|
||||
SDL_SCANCODE_KP_RIGHTPAREN = 183,
|
||||
SDL_SCANCODE_KP_LEFTBRACE = 184,
|
||||
SDL_SCANCODE_KP_RIGHTBRACE = 185,
|
||||
SDL_SCANCODE_KP_TAB = 186,
|
||||
SDL_SCANCODE_KP_BACKSPACE = 187,
|
||||
SDL_SCANCODE_KP_A = 188,
|
||||
SDL_SCANCODE_KP_B = 189,
|
||||
SDL_SCANCODE_KP_C = 190,
|
||||
SDL_SCANCODE_KP_D = 191,
|
||||
SDL_SCANCODE_KP_E = 192,
|
||||
SDL_SCANCODE_KP_F = 193,
|
||||
SDL_SCANCODE_KP_XOR = 194,
|
||||
SDL_SCANCODE_KP_POWER = 195,
|
||||
SDL_SCANCODE_KP_PERCENT = 196,
|
||||
SDL_SCANCODE_KP_LESS = 197,
|
||||
SDL_SCANCODE_KP_GREATER = 198,
|
||||
SDL_SCANCODE_KP_AMPERSAND = 199,
|
||||
SDL_SCANCODE_KP_DBLAMPERSAND = 200,
|
||||
SDL_SCANCODE_KP_VERTICALBAR = 201,
|
||||
SDL_SCANCODE_KP_DBLVERTICALBAR = 202,
|
||||
SDL_SCANCODE_KP_COLON = 203,
|
||||
SDL_SCANCODE_KP_HASH = 204,
|
||||
SDL_SCANCODE_KP_SPACE = 205,
|
||||
SDL_SCANCODE_KP_AT = 206,
|
||||
SDL_SCANCODE_KP_EXCLAM = 207,
|
||||
SDL_SCANCODE_KP_MEMSTORE = 208,
|
||||
SDL_SCANCODE_KP_MEMRECALL = 209,
|
||||
SDL_SCANCODE_KP_MEMCLEAR = 210,
|
||||
SDL_SCANCODE_KP_MEMADD = 211,
|
||||
SDL_SCANCODE_KP_MEMSUBTRACT = 212,
|
||||
SDL_SCANCODE_KP_MEMMULTIPLY = 213,
|
||||
SDL_SCANCODE_KP_MEMDIVIDE = 214,
|
||||
SDL_SCANCODE_KP_PLUSMINUS = 215,
|
||||
SDL_SCANCODE_KP_CLEAR = 216,
|
||||
SDL_SCANCODE_KP_CLEARENTRY = 217,
|
||||
SDL_SCANCODE_KP_BINARY = 218,
|
||||
SDL_SCANCODE_KP_OCTAL = 219,
|
||||
SDL_SCANCODE_KP_DECIMAL = 220,
|
||||
SDL_SCANCODE_KP_HEXADECIMAL = 221,
|
||||
|
||||
SDL_SCANCODE_LCTRL = 224,
|
||||
SDL_SCANCODE_LSHIFT = 225,
|
||||
SDL_SCANCODE_LALT = 226, /**< alt, option */
|
||||
SDL_SCANCODE_LGUI = 227, /**< windows, command (apple), meta */
|
||||
SDL_SCANCODE_RCTRL = 228,
|
||||
SDL_SCANCODE_RSHIFT = 229,
|
||||
SDL_SCANCODE_RALT = 230, /**< alt gr, option */
|
||||
SDL_SCANCODE_RGUI = 231, /**< windows, command (apple), meta */
|
||||
|
||||
SDL_SCANCODE_MODE = 257, /* I'm not sure if this is really not covered by any of the above, but since there's a special KMOD_MODE for it I'm adding it here */
|
||||
|
||||
/* These values are mapped from usage page 0x0C (USB consumer page) */
|
||||
|
||||
SDL_SCANCODE_AUDIONEXT = 258,
|
||||
SDL_SCANCODE_AUDIOPREV = 259,
|
||||
SDL_SCANCODE_AUDIOSTOP = 260,
|
||||
SDL_SCANCODE_AUDIOPLAY = 261,
|
||||
SDL_SCANCODE_AUDIOMUTE = 262,
|
||||
SDL_SCANCODE_MEDIASELECT = 263,
|
||||
SDL_SCANCODE_MAIL = 264,
|
||||
SDL_SCANCODE_CALCULATOR = 265,
|
||||
SDL_SCANCODE_COMPUTER = 266,
|
||||
SDL_SCANCODE_AC_SEARCH = 267,
|
||||
SDL_SCANCODE_AC_HOME = 268,
|
||||
SDL_SCANCODE_AC_BACK = 269,
|
||||
SDL_SCANCODE_AC_FORWARD = 270,
|
||||
SDL_SCANCODE_AC_STOP = 271,
|
||||
SDL_SCANCODE_AC_REFRESH = 272,
|
||||
SDL_SCANCODE_AC_BOOKMARKS = 273,
|
||||
|
||||
/* These are values that Christian Walther added (for mac keyboard?) */
|
||||
|
||||
SDL_SCANCODE_BRIGHTNESSDOWN = 274,
|
||||
SDL_SCANCODE_BRIGHTNESSUP = 275,
|
||||
SDL_SCANCODE_DISPLAYSWITCH = 276, /**< display mirroring/dual display switch, video mode switch */
|
||||
SDL_SCANCODE_KBDILLUMTOGGLE = 277,
|
||||
SDL_SCANCODE_KBDILLUMDOWN = 278,
|
||||
SDL_SCANCODE_KBDILLUMUP = 279,
|
||||
SDL_SCANCODE_EJECT = 280,
|
||||
SDL_SCANCODE_SLEEP = 281,
|
||||
|
||||
/* Add any other keys here */
|
||||
|
||||
SDL_NUM_SCANCODES = 512 /**< (not a key, just marks the number of scancodes for array bounds) */
|
||||
} SDL_scancode;
|
||||
|
||||
#endif /* _SDL_scancode_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
Loading…
Add table
Add a link
Reference in a new issue