comparison include/SDL_keyboard.h @ 5225:1fbe1c202501

Renamed SDL_Key to SDL_Keycode to clarify terminology.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 07 Feb 2011 10:40:21 -0800
parents c1a92e61907d
children b530ef003506
comparison
equal deleted inserted replaced
5224:c1a92e61907d 5225:1fbe1c202501
46 * \brief The SDL keysym structure, used in key events. 46 * \brief The SDL keysym structure, used in key events.
47 */ 47 */
48 typedef struct SDL_Keysym 48 typedef struct SDL_Keysym
49 { 49 {
50 SDL_Scancode scancode; /**< SDL physical key code - see ::SDL_Scancode for details */ 50 SDL_Scancode scancode; /**< SDL physical key code - see ::SDL_Scancode for details */
51 SDL_Key sym; /**< SDL virtual key code - see ::SDL_Key for details */ 51 SDL_Keycode sym; /**< SDL virtual key code - see ::SDL_Keycode for details */
52 Uint16 mod; /**< current key modifiers */ 52 Uint16 mod; /**< current key modifiers */
53 Uint32 unicode; /**< \deprecated use SDL_TextInputEvent instead */ 53 Uint32 unicode; /**< \deprecated use SDL_TextInputEvent instead */
54 } SDL_Keysym; 54 } SDL_Keysym;
55 55
56 /* Function prototypes */ 56 /* Function prototypes */
78 extern DECLSPEC Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); 78 extern DECLSPEC Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
79 79
80 /** 80 /**
81 * \brief Get the current key modifier state for the keyboard. 81 * \brief Get the current key modifier state for the keyboard.
82 */ 82 */
83 extern DECLSPEC SDL_Mod SDLCALL SDL_GetModState(void); 83 extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void);
84 84
85 /** 85 /**
86 * \brief Set the current key modifier state for the keyboard. 86 * \brief Set the current key modifier state for the keyboard.
87 * 87 *
88 * \note This does not change the keyboard state, only the key modifier flags. 88 * \note This does not change the keyboard state, only the key modifier flags.
89 */ 89 */
90 extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Mod modstate); 90 extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
91 91
92 /** 92 /**
93 * \brief Get the key code corresponding to the given scancode according 93 * \brief Get the key code corresponding to the given scancode according
94 * to the current keyboard layout. 94 * to the current keyboard layout.
95 * 95 *
96 * See ::SDL_Key for details. 96 * See ::SDL_Keycode for details.
97 * 97 *
98 * \sa SDL_GetKeyName() 98 * \sa SDL_GetKeyName()
99 */ 99 */
100 extern DECLSPEC SDL_Key SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode); 100 extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode);
101 101
102 /** 102 /**
103 * \brief Get the scancode corresponding to the given key code according to the 103 * \brief Get the scancode corresponding to the given key code according to the
104 * current keyboard layout. 104 * current keyboard layout.
105 * 105 *
106 * See ::SDL_Scancode for details. 106 * See ::SDL_Scancode for details.
107 * 107 *
108 * \sa SDL_GetScancodeName() 108 * \sa SDL_GetScancodeName()
109 */ 109 */
110 extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Key key); 110 extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key);
111 111
112 /** 112 /**
113 * \brief Get a human-readable name for a scancode. 113 * \brief Get a human-readable name for a scancode.
114 * 114 *
115 * \return A pointer to a UTF-8 string that stays valid at least until the next 115 * \return A pointer to a UTF-8 string that stays valid at least until the next
130 * copy it. If the key doesn't have a name, this function returns an 130 * copy it. If the key doesn't have a name, this function returns an
131 * empty string (""). 131 * empty string ("").
132 * 132 *
133 * \sa SDL_Key 133 * \sa SDL_Key
134 */ 134 */
135 extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Key key); 135 extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key);
136 136
137 /** 137 /**
138 * \brief Start accepting Unicode text input events. 138 * \brief Start accepting Unicode text input events.
139 * 139 *
140 * \sa SDL_StopTextInput() 140 * \sa SDL_StopTextInput()