Renamed SDLKey and SDLMod for consistency

This commit is contained in:
Sam Lantinga
2011-02-07 09:42:08 -08:00
parent 23370c8928
commit 60016c514e
12 changed files with 35 additions and 33 deletions

View File

@@ -39,12 +39,12 @@ struct SDL_Keyboard
SDL_Window *focus;
Uint16 modstate;
Uint8 keystate[SDL_NUM_SCANCODES];
SDLKey keymap[SDL_NUM_SCANCODES];
SDL_Key keymap[SDL_NUM_SCANCODES];
};
static SDL_Keyboard SDL_keyboard;
static const SDLKey SDL_default_keymap[SDL_NUM_SCANCODES] = {
static const SDL_Key SDL_default_keymap[SDL_NUM_SCANCODES] = {
0, 0, 0, 0,
'a',
'b',
@@ -572,13 +572,13 @@ SDL_ResetKeyboard(void)
}
void
SDL_GetDefaultKeymap(SDLKey * keymap)
SDL_GetDefaultKeymap(SDL_Key * keymap)
{
SDL_memcpy(keymap, SDL_default_keymap, sizeof(SDL_default_keymap));
}
void
SDL_SetKeymap(int start, SDLKey * keys, int length)
SDL_SetKeymap(int start, SDL_Key * keys, int length)
{
SDL_Keyboard *keyboard = &SDL_keyboard;
@@ -832,7 +832,7 @@ SDL_GetKeyboardState(int *numkeys)
return keyboard->keystate;
}
SDLMod
SDL_Mod
SDL_GetModState(void)
{
SDL_Keyboard *keyboard = &SDL_keyboard;
@@ -841,14 +841,14 @@ SDL_GetModState(void)
}
void
SDL_SetModState(SDLMod modstate)
SDL_SetModState(SDL_Mod modstate)
{
SDL_Keyboard *keyboard = &SDL_keyboard;
keyboard->modstate = modstate;
}
SDLKey
SDL_Key
SDL_GetKeyFromScancode(SDL_Scancode scancode)
{
SDL_Keyboard *keyboard = &SDL_keyboard;
@@ -857,7 +857,7 @@ SDL_GetKeyFromScancode(SDL_Scancode scancode)
}
SDL_Scancode
SDL_GetScancodeFromKey(SDLKey key)
SDL_GetScancodeFromKey(SDL_Key key)
{
SDL_Keyboard *keyboard = &SDL_keyboard;
SDL_Scancode scancode;
@@ -883,7 +883,7 @@ SDL_GetScancodeName(SDL_Scancode scancode)
}
const char *
SDL_GetKeyName(SDLKey key)
SDL_GetKeyName(SDL_Key key)
{
static char name[8];
char *end;

View File

@@ -34,10 +34,10 @@ extern int SDL_KeyboardInit(void);
extern void SDL_ResetKeyboard(void);
/* Get the default keymap */
extern void SDL_GetDefaultKeymap(SDLKey * keymap);
extern void SDL_GetDefaultKeymap(SDL_Key * keymap);
/* Set the mapping of scancode to key codes */
extern void SDL_SetKeymap(int start, SDLKey * keys, int length);
extern void SDL_SetKeymap(int start, SDL_Key * keys, int length);
/* Set a platform-dependent key name, overriding the default platform-agnostic
name. Encoded as UTF-8. The string is not copied, thus the pointer given to

View File

@@ -21,7 +21,7 @@
*/
#include "../../include/SDL_scancode.h"
/* Linux virtual key code to SDLKey mapping table
/* Linux virtual key code to SDL_Key mapping table
Sources:
- Linux kernel source input.h
*/

View File

@@ -30,7 +30,7 @@
void Android_InitKeyboard()
{
SDLKey keymap[SDL_NUM_SCANCODES];
SDL_Key keymap[SDL_NUM_SCANCODES];
/* Add default scancode to key mapping */
SDL_GetDefaultKeymap(keymap);

View File

@@ -586,7 +586,7 @@ class SDL_BWin:public BDirectWindow
bool inhibit_resize;
int32 last_buttons;
SDLKey keymap[128];
SDL_Key keymap[128];
};
#endif /* _SDL_BWin_h */

View File

@@ -490,7 +490,7 @@ UpdateKeymap(SDL_VideoData *data)
const void *chr_data;
int i;
SDL_Scancode scancode;
SDLKey keymap[SDL_NUM_SCANCODES];
SDL_Key keymap[SDL_NUM_SCANCODES];
/* See if the keymap needs to be updated */
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5

View File

@@ -659,7 +659,7 @@ EnumKeyboards(DFBInputDeviceID device_id,
#if USE_MULTI_API
SDL_Keyboard keyboard;
#endif
SDLKey keymap[SDL_NUM_SCANCODES];
SDL_Key keymap[SDL_NUM_SCANCODES];
if (!cb->sys_kbd) {
if (cb->sys_ids) {

View File

@@ -151,7 +151,7 @@ WIN_UpdateKeymap()
{
int i;
SDL_Scancode scancode;
SDLKey keymap[SDL_NUM_SCANCODES];
SDL_Key keymap[SDL_NUM_SCANCODES];
SDL_GetDefaultKeymap(keymap);

View File

@@ -34,7 +34,7 @@
/* *INDENT-OFF* */
static const struct {
KeySym keysym;
SDLKey sdlkey;
SDL_Key sdlkey;
} KeySymToSDLKey[] = {
{ XK_Return, SDLK_RETURN },
{ XK_Escape, SDLK_ESCAPE },
@@ -143,7 +143,7 @@ static const struct
};
/* *INDENT-OFF* */
static SDLKey
static SDL_Key
X11_KeyCodeToSDLKey(Display *display, KeyCode keycode)
{
KeySym keysym;
@@ -157,7 +157,7 @@ X11_KeyCodeToSDLKey(Display *display, KeyCode keycode)
ucs4 = X11_KeySymToUcs4(keysym);
if (ucs4) {
return (SDLKey) ucs4;
return (SDL_Key) ucs4;
}
for (i = 0; i < SDL_arraysize(KeySymToSDLKey); ++i) {
@@ -222,7 +222,7 @@ X11_InitKeyboard(_THIS)
}
if (!fingerprint_detected) {
SDLKey keymap[SDL_NUM_SCANCODES];
SDL_Key keymap[SDL_NUM_SCANCODES];
printf
("Keyboard layout unknown, please send the following to the SDL mailing list (sdl@libsdl.org):\n");
@@ -233,7 +233,7 @@ X11_InitKeyboard(_THIS)
KeySym sym;
sym = XKeycodeToKeysym(data->display, i, 0);
if (sym != NoSymbol) {
SDLKey key;
SDL_Key key;
printf("code = %d, sym = 0x%X (%s) ", i - min_keycode,
(unsigned int) sym, XKeysymToString(sym));
key = X11_KeyCodeToSDLKey(data->display, i);
@@ -265,7 +265,7 @@ X11_UpdateKeymap(_THIS)
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
int i;
SDL_Scancode scancode;
SDLKey keymap[SDL_NUM_SCANCODES];
SDL_Key keymap[SDL_NUM_SCANCODES];
SDL_zero(keymap);