mirror of
https://github.com/yawut/SDL.git
synced 2026-09-11 10:36:27 -05:00
Renamed SDLKey and SDLMod for consistency
This commit is contained in:
@@ -219,6 +219,8 @@ struct SDL_SysWMinfo;
|
||||
#define SDL_KeySym SDL_Keysym
|
||||
#define SDL_scancode SDL_Scancode
|
||||
#define SDL_ScanCode SDL_Scancode
|
||||
#define SDLKey SDL_Key
|
||||
#define SDLMod SDL_Mod
|
||||
|
||||
/**
|
||||
* \name Renamed keys
|
||||
|
||||
@@ -48,7 +48,7 @@ extern "C" {
|
||||
typedef struct SDL_Keysym
|
||||
{
|
||||
SDL_Scancode scancode; /**< SDL physical key code - see ::SDL_Scancode for details */
|
||||
SDLKey sym; /**< SDL virtual key code - see ::SDLKey for details */
|
||||
SDL_Key sym; /**< SDL virtual key code - see ::SDL_Key for details */
|
||||
Uint16 mod; /**< current key modifiers */
|
||||
Uint32 unicode; /**< \deprecated use SDL_TextInputEvent instead */
|
||||
} SDL_Keysym;
|
||||
@@ -80,24 +80,24 @@ extern DECLSPEC Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
|
||||
/**
|
||||
* \brief Get the current key modifier state for the keyboard.
|
||||
*/
|
||||
extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void);
|
||||
extern DECLSPEC SDL_Mod SDLCALL SDL_GetModState(void);
|
||||
|
||||
/**
|
||||
* \brief Set the current key modifier state for the keyboard.
|
||||
*
|
||||
* \note This does not change the keyboard state, only the key modifier flags.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate);
|
||||
extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Mod modstate);
|
||||
|
||||
/**
|
||||
* \brief Get the key code corresponding to the given scancode according
|
||||
* to the current keyboard layout.
|
||||
*
|
||||
* See ::SDLKey for details.
|
||||
* See ::SDL_Key for details.
|
||||
*
|
||||
* \sa SDL_GetKeyName()
|
||||
*/
|
||||
extern DECLSPEC SDLKey SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode);
|
||||
extern DECLSPEC SDL_Key SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode);
|
||||
|
||||
/**
|
||||
* \brief Get the scancode corresponding to the given key code according to the
|
||||
@@ -107,7 +107,7 @@ extern DECLSPEC SDLKey SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode);
|
||||
*
|
||||
* \sa SDL_GetScancodeName()
|
||||
*/
|
||||
extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDLKey key);
|
||||
extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Key key);
|
||||
|
||||
/**
|
||||
* \brief Get a human-readable name for a scancode.
|
||||
@@ -130,9 +130,9 @@ extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode
|
||||
* copy it. If the key doesn't have a name, this function returns an
|
||||
* empty string ("").
|
||||
*
|
||||
* \sa SDLKey
|
||||
* \sa SDL_Key
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDLKey key);
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Key key);
|
||||
|
||||
/**
|
||||
* \brief Start accepting Unicode text input events.
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
* the unmodified character that would be generated by pressing the key, or
|
||||
* an SDLK_* constant for those keys that do not generate characters.
|
||||
*/
|
||||
typedef Sint32 SDLKey;
|
||||
typedef Sint32 SDL_Key;
|
||||
|
||||
#define SDLK_SCANCODE_MASK (1<<30)
|
||||
#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK)
|
||||
@@ -330,7 +330,7 @@ typedef enum
|
||||
KMOD_CAPS = 0x2000,
|
||||
KMOD_MODE = 0x4000,
|
||||
KMOD_RESERVED = 0x8000
|
||||
} SDLMod;
|
||||
} SDL_Mod;
|
||||
|
||||
#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
|
||||
#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
|
||||
|
||||
Reference in New Issue
Block a user