comparison include/SDL_keyboard.h @ 5224:c1a92e61907d

Renamed SDLKey and SDLMod for consistency
author Sam Lantinga <slouken@libsdl.org>
date Mon, 07 Feb 2011 09:42:08 -0800
parents 572a73d71b5f
children 1fbe1c202501
comparison
equal deleted inserted replaced
5223:572a73d71b5f 5224:c1a92e61907d
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 SDLKey sym; /**< SDL virtual key code - see ::SDLKey for details */ 51 SDL_Key sym; /**< SDL virtual key code - see ::SDL_Key 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 SDLMod SDLCALL SDL_GetModState(void); 83 extern DECLSPEC SDL_Mod 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(SDLMod modstate); 90 extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Mod 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 ::SDLKey for details. 96 * See ::SDL_Key for details.
97 * 97 *
98 * \sa SDL_GetKeyName() 98 * \sa SDL_GetKeyName()
99 */ 99 */
100 extern DECLSPEC SDLKey SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode); 100 extern DECLSPEC SDL_Key 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(SDLKey key); 110 extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Key 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
128 * \return A pointer to a UTF-8 string that stays valid at least until the next 128 * \return A pointer to a UTF-8 string that stays valid at least until the next
129 * call to this function. If you need it around any longer, you must 129 * call to this function. If you need it around any longer, you must
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 SDLKey 133 * \sa SDL_Key
134 */ 134 */
135 extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDLKey key); 135 extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Key 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()