From d86cf5672519b6a0cf31d775d6598ed5b72d9a60 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 7 Feb 2011 09:37:11 -0800 Subject: [PATCH] Sheena pointed out that "scancode" and "keysym" are single words and shouldn't be camel-cased. --- include/SDL_compat.h | 6 ++++-- include/SDL_events.h | 2 +- include/SDL_keyboard.h | 18 ++++++++-------- include/SDL_scancode.h | 4 ++-- src/events/SDL_keyboard.c | 16 +++++++-------- src/events/SDL_keyboard_c.h | 4 ++-- src/events/scancodes_darwin.h | 2 +- src/events/scancodes_linux.h | 2 +- src/events/scancodes_windows.h | 2 +- src/events/scancodes_xfree86.h | 4 ++-- src/video/android/SDL_androidkeyboard.c | 6 +++--- src/video/bwindow/SDL_BWin.h | 4 ++-- src/video/cocoa/SDL_cocoakeyboard.m | 20 +++++++++--------- src/video/directfb/SDL_DirectFB_events.c | 26 ++++++++++++------------ src/video/directfb/SDL_DirectFB_video.h | 2 +- src/video/uikit/SDL_uikitview.m | 4 ++-- src/video/uikit/keyinfotable.h | 4 ++-- src/video/windows/SDL_windowskeyboard.c | 2 +- src/video/windows/SDL_windowsvideo.h | 2 +- src/video/x11/SDL_x11events.c | 2 +- src/video/x11/SDL_x11keyboard.c | 10 ++++----- src/video/x11/SDL_x11video.h | 2 +- test/checkkeys.c | 2 +- test/testkeys.c | 2 +- test/testwm.c | 2 +- 25 files changed, 76 insertions(+), 74 deletions(-) diff --git a/include/SDL_compat.h b/include/SDL_compat.h index 279b42802..17be87918 100644 --- a/include/SDL_compat.h +++ b/include/SDL_compat.h @@ -215,8 +215,10 @@ struct SDL_SysWMinfo; */ /*@{*/ -#define SDL_keysym SDL_KeySym -#define SDL_scancode SDL_ScanCode +#define SDL_keysym SDL_Keysym +#define SDL_KeySym SDL_Keysym +#define SDL_scancode SDL_Scancode +#define SDL_ScanCode SDL_Scancode /** * \name Renamed keys diff --git a/include/SDL_events.h b/include/SDL_events.h index 60e0dcc96..1835fa709 100644 --- a/include/SDL_events.h +++ b/include/SDL_events.h @@ -151,7 +151,7 @@ typedef struct SDL_KeyboardEvent Uint8 repeat; /**< Non-zero if this is a key repeat */ Uint8 padding2; Uint8 padding3; - SDL_KeySym keysym; /**< The key that was pressed or released */ + SDL_Keysym keysym; /**< The key that was pressed or released */ } SDL_KeyboardEvent; #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32) diff --git a/include/SDL_keyboard.h b/include/SDL_keyboard.h index 7d90a7071..3e0fea694 100644 --- a/include/SDL_keyboard.h +++ b/include/SDL_keyboard.h @@ -45,13 +45,13 @@ extern "C" { /** * \brief The SDL keysym structure, used in key events. */ -typedef struct SDL_KeySym +typedef struct SDL_Keysym { - SDL_ScanCode scancode; /**< SDL physical key code - see ::SDL_ScanCode for details */ + 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; /**< \deprecated use SDL_TextInputEvent instead */ -} SDL_KeySym; +} SDL_Keysym; /* Function prototypes */ @@ -65,7 +65,7 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void); * * \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 ::SDL_ScanCode values. + * \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values. * * \b Example: * \code @@ -97,17 +97,17 @@ extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate); * * \sa SDL_GetKeyName() */ -extern DECLSPEC SDLKey SDLCALL SDL_GetKeyFromScancode(SDL_ScanCode scancode); +extern DECLSPEC SDLKey SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode); /** * \brief Get the scancode corresponding to the given key code according to the * current keyboard layout. * - * See ::SDL_ScanCode for details. + * See ::SDL_Scancode for details. * * \sa SDL_GetScancodeName() */ -extern DECLSPEC SDL_ScanCode SDLCALL SDL_GetScancodeFromKey(SDLKey key); +extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDLKey key); /** * \brief Get a human-readable name for a scancode. @@ -117,9 +117,9 @@ extern DECLSPEC SDL_ScanCode SDLCALL SDL_GetScancodeFromKey(SDLKey key); * copy it. If the scancode doesn't have a name, this function returns * an empty string (""). * - * \sa SDL_ScanCode + * \sa SDL_Scancode */ -extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_ScanCode +extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode); /** diff --git a/include/SDL_scancode.h b/include/SDL_scancode.h index a4e273845..f8c63b85d 100644 --- a/include/SDL_scancode.h +++ b/include/SDL_scancode.h @@ -35,7 +35,7 @@ * \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 + * 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: @@ -392,7 +392,7 @@ typedef enum SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes for array bounds */ -} SDL_ScanCode; +} SDL_Scancode; #endif /* _SDL_scancode_h */ diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 307dc5386..a90eb884e 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -562,7 +562,7 @@ void SDL_ResetKeyboard(void) { SDL_Keyboard *keyboard = &SDL_keyboard; - SDL_ScanCode scancode; + SDL_Scancode scancode; for (scancode = 0; scancode < SDL_NUM_SCANCODES; ++scancode) { if (keyboard->keystate[scancode] == SDL_PRESSED) { @@ -590,7 +590,7 @@ SDL_SetKeymap(int start, SDLKey * keys, int length) } void -SDL_SetScancodeName(SDL_ScanCode scancode, const char *name) +SDL_SetScancodeName(SDL_Scancode scancode, const char *name) { SDL_scancode_names[scancode] = name; } @@ -638,7 +638,7 @@ SDL_SetKeyboardFocus(SDL_Window * window) } int -SDL_SendKeyboardKey(Uint8 state, SDL_ScanCode scancode) +SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode) { SDL_Keyboard *keyboard = &SDL_keyboard; int posted; @@ -849,18 +849,18 @@ SDL_SetModState(SDLMod modstate) } SDLKey -SDL_GetKeyFromScancode(SDL_ScanCode scancode) +SDL_GetKeyFromScancode(SDL_Scancode scancode) { SDL_Keyboard *keyboard = &SDL_keyboard; return keyboard->keymap[scancode]; } -SDL_ScanCode +SDL_Scancode SDL_GetScancodeFromKey(SDLKey key) { SDL_Keyboard *keyboard = &SDL_keyboard; - SDL_ScanCode scancode; + SDL_Scancode scancode; for (scancode = SDL_SCANCODE_UNKNOWN; scancode < SDL_NUM_SCANCODES; ++scancode) { @@ -872,7 +872,7 @@ SDL_GetScancodeFromKey(SDLKey key) } const char * -SDL_GetScancodeName(SDL_ScanCode scancode) +SDL_GetScancodeName(SDL_Scancode scancode) { const char *name = SDL_scancode_names[scancode]; @@ -890,7 +890,7 @@ SDL_GetKeyName(SDLKey key) if (key & SDLK_SCANCODE_MASK) { return - SDL_GetScancodeName((SDL_ScanCode) (key & ~SDLK_SCANCODE_MASK)); + SDL_GetScancodeName((SDL_Scancode) (key & ~SDLK_SCANCODE_MASK)); } switch (key) { diff --git a/src/events/SDL_keyboard_c.h b/src/events/SDL_keyboard_c.h index 51e7cb00b..991b2ba12 100644 --- a/src/events/SDL_keyboard_c.h +++ b/src/events/SDL_keyboard_c.h @@ -43,13 +43,13 @@ extern void SDL_SetKeymap(int start, SDLKey * keys, int length); name. Encoded as UTF-8. The string is not copied, thus the pointer given to this function must stay valid forever (or at least until the call to VideoQuit()). */ -extern void SDL_SetScancodeName(SDL_ScanCode scancode, const char *name); +extern void SDL_SetScancodeName(SDL_Scancode scancode, const char *name); /* Set the keyboard focus window */ extern void SDL_SetKeyboardFocus(SDL_Window * window); /* Send a keyboard key event */ -extern int SDL_SendKeyboardKey(Uint8 state, SDL_ScanCode scancode); +extern int SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode); /* Send keyboard text input */ extern int SDL_SendKeyboardText(const char *text); diff --git a/src/events/scancodes_darwin.h b/src/events/scancodes_darwin.h index 79496c10f..204eb0356 100644 --- a/src/events/scancodes_darwin.h +++ b/src/events/scancodes_darwin.h @@ -27,7 +27,7 @@ - experimentation on various ADB and USB ISO keyboards and one ADB ANSI keyboard */ /* *INDENT-OFF* */ -static const SDL_ScanCode darwin_scancode_table[] = { +static const SDL_Scancode darwin_scancode_table[] = { /* 0 */ SDL_SCANCODE_A, /* 1 */ SDL_SCANCODE_S, /* 2 */ SDL_SCANCODE_D, diff --git a/src/events/scancodes_linux.h b/src/events/scancodes_linux.h index 5c7f96d8c..41eb6e9ae 100644 --- a/src/events/scancodes_linux.h +++ b/src/events/scancodes_linux.h @@ -26,7 +26,7 @@ - Linux kernel source input.h */ /* *INDENT-OFF* */ -static SDL_ScanCode const linux_scancode_table[] = { +static SDL_Scancode const linux_scancode_table[] = { /* 0 */ SDL_SCANCODE_UNKNOWN, /* 1 */ SDL_SCANCODE_ESCAPE, /* 2 */ SDL_SCANCODE_1, diff --git a/src/events/scancodes_windows.h b/src/events/scancodes_windows.h index 47199ce3b..b1c6cd5dc 100644 --- a/src/events/scancodes_windows.h +++ b/src/events/scancodes_windows.h @@ -26,7 +26,7 @@ - msdn.microsoft.com */ /* *INDENT-OFF* */ -static const SDL_ScanCode windows_scancode_table[] = { +static const SDL_Scancode windows_scancode_table[] = { /* 0, 0x00 */ SDL_SCANCODE_UNKNOWN, /* 1, 0x01 */ SDL_SCANCODE_UNKNOWN, /* 2, 0x02 */ SDL_SCANCODE_UNKNOWN, diff --git a/src/events/scancodes_xfree86.h b/src/events/scancodes_xfree86.h index faa3afc17..698a0f06a 100644 --- a/src/events/scancodes_xfree86.h +++ b/src/events/scancodes_xfree86.h @@ -26,7 +26,7 @@ - atKeyNames.h from XFree86 source code */ /* *INDENT-OFF* */ -static const SDL_ScanCode xfree86_scancode_table[] = { +static const SDL_Scancode xfree86_scancode_table[] = { /* 0 */ SDL_SCANCODE_UNKNOWN, /* 1 */ SDL_SCANCODE_ESCAPE, /* 2 */ SDL_SCANCODE_1, @@ -177,7 +177,7 @@ static const SDL_ScanCode xfree86_scancode_table[] = { }; /* for wireless usb keyboard (manufacturer TRUST) without numpad. */ -static const SDL_ScanCode xfree86_scancode_table2[] = { +static const SDL_Scancode xfree86_scancode_table2[] = { /* 0 */ SDL_SCANCODE_UNKNOWN, /* 1 */ SDL_SCANCODE_ESCAPE, /* 2 */ SDL_SCANCODE_1, diff --git a/src/video/android/SDL_androidkeyboard.c b/src/video/android/SDL_androidkeyboard.c index 251eea7c2..1bbe215fd 100644 --- a/src/video/android/SDL_androidkeyboard.c +++ b/src/video/android/SDL_androidkeyboard.c @@ -37,7 +37,7 @@ void Android_InitKeyboard() SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES); } -static SDL_ScanCode Android_Keycodes[] = { +static SDL_Scancode Android_Keycodes[] = { SDL_SCANCODE_UNKNOWN, /* AKEYCODE_UNKNOWN */ SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SOFT_LEFT */ SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SOFT_RIGHT */ @@ -151,10 +151,10 @@ static SDL_ScanCode Android_Keycodes[] = { SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_MODE */ }; -static SDL_ScanCode +static SDL_Scancode TranslateKeycode(int keycode) { - SDL_ScanCode scancode = SDL_SCANCODE_UNKNOWN; + SDL_Scancode scancode = SDL_SCANCODE_UNKNOWN; if (keycode < SDL_arraysize(Android_Keycodes)) { scancode = Android_Keycodes[keycode]; diff --git a/src/video/bwindow/SDL_BWin.h b/src/video/bwindow/SDL_BWin.h index 94ddd3417..832db435b 100644 --- a/src/video/bwindow/SDL_BWin.h +++ b/src/video/bwindow/SDL_BWin.h @@ -509,7 +509,7 @@ class SDL_BWin:public BDirectWindow if (msg->FindInt32("key", &key) == B_OK && msg->FindInt32("modifiers", &modifiers) == B_OK) { - SDL_KeySym keysym; + SDL_Keysym keysym; keysym.scancode = key; if ((key > 0) && (key < 128)) { keysym.sym = keymap[key]; @@ -543,7 +543,7 @@ class SDL_BWin:public BDirectWindow int32 modifiers; if (msg->FindInt32("key", &key) == B_OK && msg->FindInt32("modifiers", &modifiers) == B_OK) { - SDL_KeySym keysym; + SDL_Keysym keysym; keysym.scancode = key; if ((key > 0) && (key < 128)) { keysym.sym = keymap[key]; diff --git a/src/video/cocoa/SDL_cocoakeyboard.m b/src/video/cocoa/SDL_cocoakeyboard.m index da11d7711..589c9b5e9 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.m +++ b/src/video/cocoa/SDL_cocoakeyboard.m @@ -246,7 +246,7 @@ - (NSArray *) validAttributesForMarkedText HandleNonDeviceModifier(unsigned int device_independent_mask, unsigned int oldMods, unsigned int newMods, - SDL_ScanCode scancode) + SDL_Scancode scancode) { unsigned int oldMask, newMask; @@ -268,7 +268,7 @@ - (NSArray *) validAttributesForMarkedText */ static void HandleModifierOneSide(unsigned int oldMods, unsigned int newMods, - SDL_ScanCode scancode, + SDL_Scancode scancode, unsigned int sided_device_dependent_mask) { unsigned int old_dep_mask, new_dep_mask; @@ -297,8 +297,8 @@ - (NSArray *) validAttributesForMarkedText static void HandleModifierSide(int device_independent_mask, unsigned int oldMods, unsigned int newMods, - SDL_ScanCode left_scancode, - SDL_ScanCode right_scancode, + SDL_Scancode left_scancode, + SDL_Scancode right_scancode, unsigned int left_device_dependent_mask, unsigned int right_device_dependent_mask) { @@ -341,8 +341,8 @@ - (NSArray *) validAttributesForMarkedText static void ReleaseModifierSide(unsigned int device_independent_mask, unsigned int oldMods, unsigned int newMods, - SDL_ScanCode left_scancode, - SDL_ScanCode right_scancode, + SDL_Scancode left_scancode, + SDL_Scancode right_scancode, unsigned int left_device_dependent_mask, unsigned int right_device_dependent_mask) { @@ -409,13 +409,13 @@ - (NSArray *) validAttributesForMarkedText unsigned int oldMods, unsigned int newMods) { /* Set up arrays for the key syms for the left and right side. */ - const SDL_ScanCode left_mapping[] = { + const SDL_Scancode left_mapping[] = { SDL_SCANCODE_LSHIFT, SDL_SCANCODE_LCTRL, SDL_SCANCODE_LALT, SDL_SCANCODE_LGUI }; - const SDL_ScanCode right_mapping[] = { + const SDL_Scancode right_mapping[] = { SDL_SCANCODE_RSHIFT, SDL_SCANCODE_RCTRL, SDL_SCANCODE_RALT, @@ -489,7 +489,7 @@ - (NSArray *) validAttributesForMarkedText #endif const void *chr_data; int i; - SDL_ScanCode scancode; + SDL_Scancode scancode; SDLKey keymap[SDL_NUM_SCANCODES]; /* See if the keymap needs to be updated */ @@ -675,7 +675,7 @@ - (NSArray *) validAttributesForMarkedText { SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; unsigned short scancode = [event keyCode]; - SDL_ScanCode code; + SDL_Scancode code; #if 0 const char *text; #endif diff --git a/src/video/directfb/SDL_DirectFB_events.c b/src/video/directfb/SDL_DirectFB_events.c index 123597898..047e97998 100644 --- a/src/video/directfb/SDL_DirectFB_events.c +++ b/src/video/directfb/SDL_DirectFB_events.c @@ -61,15 +61,15 @@ struct _cb_data }; /* The translation tables from a DirectFB keycode to a SDL keysym */ -static SDL_ScanCode oskeymap[256]; +static SDL_Scancode oskeymap[256]; -static SDL_KeySym *DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, - SDL_KeySym * keysym); -static SDL_KeySym *DirectFB_TranslateKeyInputEvent(_THIS, DFBInputEvent * evt, - SDL_KeySym * keysym); +static SDL_Keysym *DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, + SDL_Keysym * keysym); +static SDL_Keysym *DirectFB_TranslateKeyInputEvent(_THIS, DFBInputEvent * evt, + SDL_Keysym * keysym); -static void DirectFB_InitOSKeymap(_THIS, SDL_ScanCode * keypmap, int numkeys); +static void DirectFB_InitOSKeymap(_THIS, SDL_Scancode * keypmap, int numkeys); static int DirectFB_TranslateButton(DFBInputDeviceButtonIdentifier button); static void UnicodeToUtf8( Uint16 w , char *utf8buf) @@ -176,7 +176,7 @@ ProcessWindowEvent(_THIS, SDL_Window *sdlwin, DFBWindowEvent * evt) { SDL_DFB_DEVICEDATA(_this); SDL_DFB_WINDOWDATA(sdlwin); - SDL_KeySym keysym; + SDL_Keysym keysym; char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; if (evt->clazz == DFEC_WINDOW) { @@ -308,7 +308,7 @@ static void ProcessInputEvent(_THIS, DFBInputEvent * ievt) { SDL_DFB_DEVICEDATA(_this); - SDL_KeySym keysym; + SDL_Keysym keysym; int kbd_idx; char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; @@ -448,7 +448,7 @@ DirectFB_PumpEventsWindow(_THIS) } void -DirectFB_InitOSKeymap(_THIS, SDL_ScanCode * keymap, int numkeys) +DirectFB_InitOSKeymap(_THIS, SDL_Scancode * keymap, int numkeys) { int i; @@ -575,8 +575,8 @@ DirectFB_InitOSKeymap(_THIS, SDL_ScanCode * keymap, int numkeys) } -static SDL_KeySym * -DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, SDL_KeySym * keysym) +static SDL_Keysym * +DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, SDL_Keysym * keysym) { SDL_DFB_DEVICEDATA(_this); int kbd_idx = 0; /* Window events lag the device source KbdIndex(_this, evt->device_id); */ @@ -605,9 +605,9 @@ DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, SDL_KeySym * keysym) return keysym; } -static SDL_KeySym * +static SDL_Keysym * DirectFB_TranslateKeyInputEvent(_THIS, DFBInputEvent * evt, - SDL_KeySym * keysym) + SDL_Keysym * keysym) { SDL_DFB_DEVICEDATA(_this); int kbd_idx = KbdIndex(_this, evt->device_id); diff --git a/src/video/directfb/SDL_DirectFB_video.h b/src/video/directfb/SDL_DirectFB_video.h index fed1b7856..b2e312d4b 100644 --- a/src/video/directfb/SDL_DirectFB_video.h +++ b/src/video/directfb/SDL_DirectFB_video.h @@ -142,7 +142,7 @@ static inline DFBResult sdl_dfb_check(DFBResult ret, const char *src_file, int s typedef struct _DFB_KeyboardData DFB_KeyboardData; struct _DFB_KeyboardData { - const SDL_ScanCode *map; /* keyboard scancode map */ + const SDL_Scancode *map; /* keyboard scancode map */ int map_size; /* size of map */ int map_adjust; /* index adjust */ int is_generic; /* generic keyboard */ diff --git a/src/video/uikit/SDL_uikitview.m b/src/video/uikit/SDL_uikitview.m index e91088cc5..1eb8685be 100644 --- a/src/video/uikit/SDL_uikitview.m +++ b/src/video/uikit/SDL_uikitview.m @@ -267,10 +267,10 @@ - (BOOL)textField:(UITextField *)_textField shouldChangeCharactersInRange:(NSRan unichar c = [string characterAtIndex: i]; Uint16 mod = 0; - SDL_ScanCode code; + SDL_Scancode code; if (c < 127) { - /* figure out the SDL_ScanCode and SDL_keymod for this unichar */ + /* figure out the SDL_Scancode and SDL_keymod for this unichar */ code = unicharToUIKeyInfoTable[c].code; mod = unicharToUIKeyInfoTable[c].mod; } diff --git a/src/video/uikit/keyinfotable.h b/src/video/uikit/keyinfotable.h index 63931b6cd..7f9d2838a 100644 --- a/src/video/uikit/keyinfotable.h +++ b/src/video/uikit/keyinfotable.h @@ -27,14 +27,14 @@ /* This file is used by the keyboard code in SDL_uikitview.m to convert between characters - passed in from the iPhone's virtual keyboard, and tuples of SDL_ScanCodes and SDL_keymods. + passed in from the iPhone's virtual keyboard, and tuples of SDL_Scancode and SDL_keymods. For example unicharToUIKeyInfoTable['a'] would give you the scan code and keymod for lower case a. */ typedef struct { - SDL_ScanCode code; + SDL_Scancode code; Uint16 mod; } UIKitKeyInfo; diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index c107f4970..c064d8ecc 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -150,7 +150,7 @@ void WIN_UpdateKeymap() { int i; - SDL_ScanCode scancode; + SDL_Scancode scancode; SDLKey keymap[SDL_NUM_SCANCODES]; SDL_GetDefaultKeymap(keymap); diff --git a/src/video/windows/SDL_windowsvideo.h b/src/video/windows/SDL_windowsvideo.h index 2303c9ffe..4da0d1c94 100644 --- a/src/video/windows/SDL_windowsvideo.h +++ b/src/video/windows/SDL_windowsvideo.h @@ -123,7 +123,7 @@ typedef struct SDL_VideoData PFCoordTransform CoordTransform; #endif - const SDL_ScanCode *key_layout; + const SDL_Scancode *key_layout; DWORD clipboard_count; /* Touch input functions */ diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index ec3d8322c..0239f18ad 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -202,7 +202,7 @@ X11_DispatchEvent(_THIS) case KeyPress:{ KeyCode keycode = xevent.xkey.keycode; KeySym keysym = NoSymbol; - SDL_ScanCode scancode; + SDL_Scancode scancode; char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; Status status = 0; diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c index 5dc479f5b..6ee3a18d0 100644 --- a/src/video/x11/SDL_x11keyboard.c +++ b/src/video/x11/SDL_x11keyboard.c @@ -134,7 +134,7 @@ static const struct { static const struct { - const SDL_ScanCode const *table; + const SDL_Scancode const *table; int table_size; } scancode_set[] = { { darwin_scancode_table, SDL_arraysize(darwin_scancode_table) }, @@ -175,7 +175,7 @@ X11_InitKeyboard(_THIS) int i, j; int min_keycode, max_keycode; struct { - SDL_ScanCode scancode; + SDL_Scancode scancode; KeySym keysym; int value; } fingerprint[] = { @@ -215,7 +215,7 @@ X11_InitKeyboard(_THIS) printf("Using scancode set %d, min_keycode = %d, max_keycode = %d, table_size = %d\n", i, min_keycode, max_keycode, scancode_set[i].table_size); #endif SDL_memcpy(&data->key_layout[min_keycode], scancode_set[i].table, - sizeof(SDL_ScanCode) * scancode_set[i].table_size); + sizeof(SDL_Scancode) * scancode_set[i].table_size); fingerprint_detected = SDL_TRUE; break; } @@ -239,7 +239,7 @@ X11_InitKeyboard(_THIS) key = X11_KeyCodeToSDLKey(data->display, i); for (j = 0; j < SDL_arraysize(keymap); ++j) { if (keymap[j] == key) { - data->key_layout[i] = (SDL_ScanCode) j; + data->key_layout[i] = (SDL_Scancode) j; break; } } @@ -264,7 +264,7 @@ X11_UpdateKeymap(_THIS) { SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; int i; - SDL_ScanCode scancode; + SDL_Scancode scancode; SDLKey keymap[SDL_NUM_SCANCODES]; SDL_zero(keymap); diff --git a/src/video/x11/SDL_x11video.h b/src/video/x11/SDL_x11video.h index cdfd6f746..9b0b34a15 100644 --- a/src/video/x11/SDL_x11video.h +++ b/src/video/x11/SDL_x11video.h @@ -89,7 +89,7 @@ typedef struct SDL_VideoData Atom _NET_WM_ICON; Atom UTF8_STRING; - SDL_ScanCode key_layout[256]; + SDL_Scancode key_layout[256]; SDL_bool selection_waiting; } SDL_VideoData; diff --git a/test/checkkeys.c b/test/checkkeys.c index 909f43113..b54f4daa7 100644 --- a/test/checkkeys.c +++ b/test/checkkeys.c @@ -53,7 +53,7 @@ print_modifiers(void) } static void -PrintKey(SDL_KeySym * sym, SDL_bool pressed, SDL_bool repeat) +PrintKey(SDL_Keysym * sym, SDL_bool pressed, SDL_bool repeat) { /* Print the keycode, name and state */ if (sym->sym) { diff --git a/test/testkeys.c b/test/testkeys.c index 9891e689a..e12fbfad4 100644 --- a/test/testkeys.c +++ b/test/testkeys.c @@ -11,7 +11,7 @@ int main(int argc, char *argv[]) { - SDL_ScanCode scancode; + SDL_Scancode scancode; if (SDL_Init(SDL_INIT_VIDEO) < 0) { fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError()); diff --git a/test/testwm.c b/test/testwm.c index 68ae51ccf..5182c76d4 100644 --- a/test/testwm.c +++ b/test/testwm.c @@ -210,7 +210,7 @@ print_modifiers(void) printf(" MODE"); } -static void PrintKey(const SDL_KeySym *sym, int pressed) +static void PrintKey(const SDL_Keysym *sym, int pressed) { /* Print the keycode, name and state */ if ( sym->sym ) {