From e8dbbf8380dcbb4856e106faebd58b25366a6ea9 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 30 Jun 2024 20:05:22 -0700 Subject: [PATCH] Renamed SDLK_a-z to SDLK_A-Z Made the symbols uppercase for consistency with the other SDLK_* constants, but the values are still lowercase. --- build-scripts/SDL_migration.cocci | 104 ++++++++++++++++++++ docs/README-migration.md | 28 +++++- include/SDL3/SDL_keycode.h | 52 +++++----- include/SDL3/SDL_oldnames.h | 52 ++++++++++ src/events/SDL_keymap.c | 4 +- src/test/SDL_test_common.c | 26 ++--- src/video/emscripten/SDL_emscriptenevents.c | 52 +++++----- test/testaudiostreamdynamicresample.c | 12 +-- test/testautomation_keyboard.c | 4 +- test/testcontroller.c | 12 +-- test/testgl.c | 4 +- test/testhittesting.c | 2 +- test/testintersections.c | 4 +- test/testmodal.c | 8 +- test/testmouse.c | 2 +- test/testwm.c | 2 +- 16 files changed, 275 insertions(+), 93 deletions(-) diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci index 328b359e0..fef3d3536 100644 --- a/build-scripts/SDL_migration.cocci +++ b/build-scripts/SDL_migration.cocci @@ -3384,3 +3384,107 @@ typedef SDL_Colour, SDL_Color; @@ - SDLK_MEDIASELECT + SDLK_MEDIA_SELECT +@@ +@@ +- SDLK_a ++ SDLK_A +@@ +@@ +- SDLK_b ++ SDLK_B +@@ +@@ +- SDLK_c ++ SDLK_C +@@ +@@ +- SDLK_d ++ SDLK_D +@@ +@@ +- SDLK_e ++ SDLK_E +@@ +@@ +- SDLK_f ++ SDLK_F +@@ +@@ +- SDLK_g ++ SDLK_G +@@ +@@ +- SDLK_h ++ SDLK_H +@@ +@@ +- SDLK_i ++ SDLK_I +@@ +@@ +- SDLK_j ++ SDLK_J +@@ +@@ +- SDLK_k ++ SDLK_K +@@ +@@ +- SDLK_l ++ SDLK_L +@@ +@@ +- SDLK_m ++ SDLK_M +@@ +@@ +- SDLK_n ++ SDLK_N +@@ +@@ +- SDLK_o ++ SDLK_O +@@ +@@ +- SDLK_p ++ SDLK_P +@@ +@@ +- SDLK_q ++ SDLK_Q +@@ +@@ +- SDLK_r ++ SDLK_R +@@ +@@ +- SDLK_s ++ SDLK_S +@@ +@@ +- SDLK_t ++ SDLK_T +@@ +@@ +- SDLK_u ++ SDLK_U +@@ +@@ +- SDLK_v ++ SDLK_V +@@ +@@ +- SDLK_w ++ SDLK_W +@@ +@@ +- SDLK_x ++ SDLK_X +@@ +@@ +- SDLK_y ++ SDLK_Y +@@ +@@ +- SDLK_z ++ SDLK_Z diff --git a/docs/README-migration.md b/docs/README-migration.md index 39f3d44a1..236af3de9 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -362,7 +362,7 @@ now looks like this: SDL_Keymod mod = event.key.mod; ``` -The keycode in key events is affected by modifiers by default. e.g. pressing the A key would generate the keycode `SDLK_a`, or 'a', and pressing it while holding the shift key would generate the keycode `SDLK_A`, or 'A'. This behavior can be customized with `SDL_HINT_KEYCODE_OPTIONS`. +The keycode in key events is affected by modifiers by default. e.g. pressing the A key would generate the keycode `SDLK_A`, or 'a', and pressing it while holding the shift key would generate the keycode `SDLK_A`, or 'A'. This behavior can be customized with `SDL_HINT_KEYCODE_OPTIONS`. The gamepad event structures caxis, cbutton, cdevice, ctouchpad, and csensor have been renamed gaxis, gbutton, gdevice, gtouchpad, and gsensor. @@ -975,6 +975,32 @@ The following symbols have been renamed: * SDLK_MEDIASELECT => SDLK_MEDIA_SELECT * SDLK_QUOTE => SDLK_APOSTROPHE * SDLK_QUOTEDBL => SDLK_DBLAPOSTROPHE +* SDLK_a => SDLK_A +* SDLK_b => SDLK_B +* SDLK_c => SDLK_C +* SDLK_d => SDLK_D +* SDLK_e => SDLK_E +* SDLK_f => SDLK_F +* SDLK_g => SDLK_G +* SDLK_h => SDLK_H +* SDLK_i => SDLK_I +* SDLK_j => SDLK_J +* SDLK_k => SDLK_K +* SDLK_l => SDLK_L +* SDLK_m => SDLK_M +* SDLK_n => SDLK_N +* SDLK_o => SDLK_O +* SDLK_p => SDLK_P +* SDLK_q => SDLK_Q +* SDLK_r => SDLK_R +* SDLK_s => SDLK_S +* SDLK_t => SDLK_T +* SDLK_u => SDLK_U +* SDLK_v => SDLK_V +* SDLK_w => SDLK_W +* SDLK_x => SDLK_X +* SDLK_y => SDLK_Y +* SDLK_z => SDLK_Z ## SDL_loadso.h diff --git a/include/SDL3/SDL_keycode.h b/include/SDL3/SDL_keycode.h index f3a98a34b..ef612ab4e 100644 --- a/include/SDL3/SDL_keycode.h +++ b/include/SDL3/SDL_keycode.h @@ -94,32 +94,32 @@ typedef Uint32 SDL_Keycode; #define SDLK_CARET 0x0000005eu /* '^' */ #define SDLK_UNDERSCORE 0x0000005fu /* '_' */ #define SDLK_GRAVE 0x00000060u /* '`' */ -#define SDLK_a 0x00000061u /* 'a' */ -#define SDLK_b 0x00000062u /* 'b' */ -#define SDLK_c 0x00000063u /* 'c' */ -#define SDLK_d 0x00000064u /* 'd' */ -#define SDLK_e 0x00000065u /* 'e' */ -#define SDLK_f 0x00000066u /* 'f' */ -#define SDLK_g 0x00000067u /* 'g' */ -#define SDLK_h 0x00000068u /* 'h' */ -#define SDLK_i 0x00000069u /* 'i' */ -#define SDLK_j 0x0000006au /* 'j' */ -#define SDLK_k 0x0000006bu /* 'k' */ -#define SDLK_l 0x0000006cu /* 'l' */ -#define SDLK_m 0x0000006du /* 'm' */ -#define SDLK_n 0x0000006eu /* 'n' */ -#define SDLK_o 0x0000006fu /* 'o' */ -#define SDLK_p 0x00000070u /* 'p' */ -#define SDLK_q 0x00000071u /* 'q' */ -#define SDLK_r 0x00000072u /* 'r' */ -#define SDLK_s 0x00000073u /* 's' */ -#define SDLK_t 0x00000074u /* 't' */ -#define SDLK_u 0x00000075u /* 'u' */ -#define SDLK_v 0x00000076u /* 'v' */ -#define SDLK_w 0x00000077u /* 'w' */ -#define SDLK_x 0x00000078u /* 'x' */ -#define SDLK_y 0x00000079u /* 'y' */ -#define SDLK_z 0x0000007au /* 'z' */ +#define SDLK_A 0x00000061u /* 'a' */ +#define SDLK_B 0x00000062u /* 'b' */ +#define SDLK_C 0x00000063u /* 'c' */ +#define SDLK_D 0x00000064u /* 'd' */ +#define SDLK_E 0x00000065u /* 'e' */ +#define SDLK_F 0x00000066u /* 'f' */ +#define SDLK_G 0x00000067u /* 'g' */ +#define SDLK_H 0x00000068u /* 'h' */ +#define SDLK_I 0x00000069u /* 'i' */ +#define SDLK_J 0x0000006au /* 'j' */ +#define SDLK_K 0x0000006bu /* 'k' */ +#define SDLK_L 0x0000006cu /* 'l' */ +#define SDLK_M 0x0000006du /* 'm' */ +#define SDLK_N 0x0000006eu /* 'n' */ +#define SDLK_O 0x0000006fu /* 'o' */ +#define SDLK_P 0x00000070u /* 'p' */ +#define SDLK_Q 0x00000071u /* 'q' */ +#define SDLK_R 0x00000072u /* 'r' */ +#define SDLK_S 0x00000073u /* 's' */ +#define SDLK_T 0x00000074u /* 't' */ +#define SDLK_U 0x00000075u /* 'u' */ +#define SDLK_V 0x00000076u /* 'v' */ +#define SDLK_W 0x00000077u /* 'w' */ +#define SDLK_X 0x00000078u /* 'x' */ +#define SDLK_Y 0x00000079u /* 'y' */ +#define SDLK_Z 0x0000007au /* 'z' */ #define SDLK_LEFTBRACE 0x0000007bu /* '{' */ #define SDLK_PIPE 0x0000007cu /* '|' */ #define SDLK_RIGHTBRACE 0x0000007du /* '}' */ diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h index 68c8f4a58..7d1bf8360 100644 --- a/include/SDL3/SDL_oldnames.h +++ b/include/SDL3/SDL_oldnames.h @@ -378,6 +378,32 @@ #define SDLK_MEDIASELECT SDLK_MEDIA_SELECT #define SDLK_QUOTE SDLK_APOSTROPHE #define SDLK_QUOTEDBL SDLK_DBLAPOSTROPHE +#define SDLK_a SDLK_A +#define SDLK_b SDLK_B +#define SDLK_c SDLK_C +#define SDLK_d SDLK_D +#define SDLK_e SDLK_E +#define SDLK_f SDLK_F +#define SDLK_g SDLK_G +#define SDLK_h SDLK_H +#define SDLK_i SDLK_I +#define SDLK_j SDLK_J +#define SDLK_k SDLK_K +#define SDLK_l SDLK_L +#define SDLK_m SDLK_M +#define SDLK_n SDLK_N +#define SDLK_o SDLK_O +#define SDLK_p SDLK_P +#define SDLK_q SDLK_Q +#define SDLK_r SDLK_R +#define SDLK_s SDLK_S +#define SDLK_t SDLK_T +#define SDLK_u SDLK_U +#define SDLK_v SDLK_V +#define SDLK_w SDLK_W +#define SDLK_x SDLK_X +#define SDLK_y SDLK_Y +#define SDLK_z SDLK_Z /* ##SDL_log.h */ #define SDL_LogGetOutputFunction SDL_GetLogOutputFunction @@ -947,6 +973,32 @@ #define SDLK_MEDIASELECT SDLK_MEDIASELECT_renamed_SDLK_MEDIA_SELECT #define SDLK_QUOTE SDLK_QUOTE_renamed_SDLK_APOSTROPHE #define SDLK_QUOTEDBL SDLK_QUOTEDBL_renamed_SDLK_DBLAPOSTROPHE +#define SDLK_a SDLK_a_renamed_SDLK_A +#define SDLK_b SDLK_b_renamed_SDLK_B +#define SDLK_c SDLK_c_renamed_SDLK_C +#define SDLK_d SDLK_d_renamed_SDLK_D +#define SDLK_e SDLK_e_renamed_SDLK_E +#define SDLK_f SDLK_f_renamed_SDLK_F +#define SDLK_g SDLK_g_renamed_SDLK_G +#define SDLK_h SDLK_h_renamed_SDLK_H +#define SDLK_i SDLK_i_renamed_SDLK_I +#define SDLK_j SDLK_j_renamed_SDLK_J +#define SDLK_k SDLK_k_renamed_SDLK_K +#define SDLK_l SDLK_l_renamed_SDLK_L +#define SDLK_m SDLK_m_renamed_SDLK_M +#define SDLK_n SDLK_n_renamed_SDLK_N +#define SDLK_o SDLK_o_renamed_SDLK_O +#define SDLK_p SDLK_p_renamed_SDLK_P +#define SDLK_q SDLK_q_renamed_SDLK_Q +#define SDLK_r SDLK_r_renamed_SDLK_R +#define SDLK_s SDLK_s_renamed_SDLK_S +#define SDLK_t SDLK_t_renamed_SDLK_T +#define SDLK_u SDLK_u_renamed_SDLK_U +#define SDLK_v SDLK_v_renamed_SDLK_V +#define SDLK_w SDLK_w_renamed_SDLK_W +#define SDLK_x SDLK_x_renamed_SDLK_X +#define SDLK_y SDLK_y_renamed_SDLK_Y +#define SDLK_z SDLK_z_renamed_SDLK_Z /* ##SDL_log.h */ #define SDL_LogGetOutputFunction SDL_LogGetOutputFunction_renamed_SDL_GetLogOutputFunction diff --git a/src/events/SDL_keymap.c b/src/events/SDL_keymap.c index b2182ebb5..4249465cf 100644 --- a/src/events/SDL_keymap.c +++ b/src/events/SDL_keymap.c @@ -257,8 +257,8 @@ SDL_Scancode SDL_GetDefaultScancodeFromKey(SDL_Keycode key, SDL_Keymod *modstate return (SDL_Scancode)(key & ~SDLK_SCANCODE_MASK); } - if (key >= SDLK_a && key <= SDLK_z) { - return (SDL_Scancode)(SDL_SCANCODE_A + key - SDLK_a); + if (key >= SDLK_A && key <= SDLK_Z) { + return (SDL_Scancode)(SDL_SCANCODE_A + key - SDLK_A); } if (key >= 'A' && key <= 'Z') { diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index f713a5671..0a6f3b30e 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -2206,7 +2206,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_o: + case SDLK_O: if (withControl) { /* Ctrl-O (or Ctrl-Shift-O) changes window opacity. */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); @@ -2223,7 +2223,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_h: + case SDLK_H: if (withControl) { /* Ctrl-H changes cursor visibility. */ if (SDL_CursorVisible()) { @@ -2233,7 +2233,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_c: + case SDLK_C: if (withAlt) { /* Alt-C copy awesome text to the primary selection! */ SDL_SetPrimarySelectionText("SDL rocks!\nYou know it!"); @@ -2258,7 +2258,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event break; } break; - case SDLK_v: + case SDLK_V: if (withAlt) { /* Alt-V paste awesome text from the primary selection! */ char *text = SDL_GetPrimarySelectionText(); @@ -2285,7 +2285,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_f: + case SDLK_F: if (withControl) { /* Ctrl-F flash the window */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); @@ -2294,7 +2294,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_g: + case SDLK_G: if (withControl) { /* Ctrl-G toggle mouse grab */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); @@ -2303,7 +2303,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_k: + case SDLK_K: if (withControl) { /* Ctrl-K toggle keyboard grab */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); @@ -2312,7 +2312,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_m: + case SDLK_M: if (withControl) { /* Ctrl-M maximize */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); @@ -2334,13 +2334,13 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_r: + case SDLK_R: if (withControl) { /* Ctrl-R toggle mouse relative mode */ SDL_SetRelativeMouseMode(!SDL_GetRelativeMouseMode()); } break; - case SDLK_t: + case SDLK_T: if (withControl) { /* Ctrl-T toggle topmost mode */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); @@ -2354,7 +2354,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_z: + case SDLK_Z: if (withControl) { /* Ctrl-Z minimize */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); @@ -2393,7 +2393,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } break; - case SDLK_b: + case SDLK_B: if (withControl) { /* Ctrl-B toggle window border */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); @@ -2404,7 +2404,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_a: + case SDLK_A: if (withControl) { /* Ctrl-A toggle aspect ratio */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); diff --git a/src/video/emscripten/SDL_emscriptenevents.c b/src/video/emscripten/SDL_emscriptenevents.c index fa6a0d1c9..4ccf81678 100644 --- a/src/video/emscripten/SDL_emscriptenevents.c +++ b/src/video/emscripten/SDL_emscriptenevents.c @@ -104,32 +104,32 @@ static const SDL_Keycode emscripten_keycode_table[] = { /* 62 */ SDLK_UNKNOWN, /* 63 */ SDLK_MINUS, /* 64 */ SDLK_UNKNOWN, - /* 65 */ SDLK_a, - /* 66 */ SDLK_b, - /* 67 */ SDLK_c, - /* 68 */ SDLK_d, - /* 69 */ SDLK_e, - /* 70 */ SDLK_f, - /* 71 */ SDLK_g, - /* 72 */ SDLK_h, - /* 73 */ SDLK_i, - /* 74 */ SDLK_j, - /* 75 */ SDLK_k, - /* 76 */ SDLK_l, - /* 77 */ SDLK_m, - /* 78 */ SDLK_n, - /* 79 */ SDLK_o, - /* 80 */ SDLK_p, - /* 81 */ SDLK_q, - /* 82 */ SDLK_r, - /* 83 */ SDLK_s, - /* 84 */ SDLK_t, - /* 85 */ SDLK_u, - /* 86 */ SDLK_v, - /* 87 */ SDLK_w, - /* 88 */ SDLK_x, - /* 89 */ SDLK_y, - /* 90 */ SDLK_z, + /* 65 */ SDLK_A, + /* 66 */ SDLK_B, + /* 67 */ SDLK_C, + /* 68 */ SDLK_D, + /* 69 */ SDLK_E, + /* 70 */ SDLK_F, + /* 71 */ SDLK_G, + /* 72 */ SDLK_H, + /* 73 */ SDLK_I, + /* 74 */ SDLK_J, + /* 75 */ SDLK_K, + /* 76 */ SDLK_L, + /* 77 */ SDLK_M, + /* 78 */ SDLK_N, + /* 79 */ SDLK_O, + /* 80 */ SDLK_P, + /* 81 */ SDLK_Q, + /* 82 */ SDLK_R, + /* 83 */ SDLK_S, + /* 84 */ SDLK_T, + /* 85 */ SDLK_U, + /* 86 */ SDLK_V, + /* 87 */ SDLK_W, + /* 88 */ SDLK_X, + /* 89 */ SDLK_Y, + /* 90 */ SDLK_Z, /* 91 */ SDLK_LGUI, /* 92 */ SDLK_UNKNOWN, /* 93 */ SDLK_APPLICATION, diff --git a/test/testaudiostreamdynamicresample.c b/test/testaudiostreamdynamicresample.c index b22af114d..a0a949e62 100644 --- a/test/testaudiostreamdynamicresample.c +++ b/test/testaudiostreamdynamicresample.c @@ -219,22 +219,22 @@ static void loop(void) #endif if (e.type == SDL_EVENT_KEY_DOWN) { SDL_Keycode key = e.key.key; - if (key == SDLK_q) { + if (key == SDLK_Q) { if (SDL_AudioDevicePaused(state->audio_id)) { SDL_ResumeAudioDevice(state->audio_id); } else { SDL_PauseAudioDevice(state->audio_id); } - } else if (key == SDLK_w) { + } else if (key == SDLK_W) { auto_loop = !auto_loop; - } else if (key == SDLK_e) { + } else if (key == SDLK_E) { auto_flush = !auto_flush; - } else if (key == SDLK_a) { + } else if (key == SDLK_A) { SDL_ClearAudioStream(stream); SDL_Log("Cleared audio stream"); - } else if (key == SDLK_s) { + } else if (key == SDLK_S) { queue_audio(); - } else if (key == SDLK_d) { + } else if (key == SDLK_D) { float amount = 1.0f; amount *= (e.key.mod & SDL_KMOD_CTRL) ? 10.0f : 1.0f; amount *= (e.key.mod & SDL_KMOD_SHIFT) ? 10.0f : 1.0f; diff --git a/test/testautomation_keyboard.c b/test/testautomation_keyboard.c index 25a4d9b7f..87f27817a 100644 --- a/test/testautomation_keyboard.c +++ b/test/testautomation_keyboard.c @@ -61,7 +61,7 @@ static int keyboard_getKeyFromName(void *arg) /* Case where Key is known, 1 character input */ result = SDL_GetKeyFromName("A"); SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/single)"); - SDLTest_AssertCheck(result == SDLK_a, "Verify result from call, expected: %d, got: %" SDL_PRIs32, SDLK_a, result); + SDLTest_AssertCheck(result == SDLK_A, "Verify result from call, expected: %d, got: %" SDL_PRIs32, SDLK_A, result); /* Case where Key is known, 2 character input */ result = SDL_GetKeyFromName("F1"); @@ -126,7 +126,7 @@ static int keyboard_getKeyFromScancode(void *arg) /* Case where input is valid */ result = SDL_GetKeyFromScancode(SDL_SCANCODE_A, SDL_KMOD_NONE); SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(valid)"); - SDLTest_AssertCheck(result == SDLK_a, "Verify result from call, expected: %d, got: %" SDL_PRIs32, SDLK_a, result); + SDLTest_AssertCheck(result == SDLK_A, "Verify result from call, expected: %d, got: %" SDL_PRIs32, SDLK_A, result); /* Case where input is zero */ result = SDL_GetKeyFromScancode(SDL_SCANCODE_UNKNOWN, SDL_KMOD_NONE); diff --git a/test/testcontroller.c b/test/testcontroller.c index 3b7f0c952..5c50d21f6 100644 --- a/test/testcontroller.c +++ b/test/testcontroller.c @@ -1853,30 +1853,30 @@ static void loop(void *arg) SDL_SetGamepadPlayerIndex(controller->gamepad, player_index); } break; - } else if (event.key.key == SDLK_a) { + } else if (event.key.key == SDLK_A) { OpenVirtualGamepad(); - } else if (event.key.key == SDLK_d) { + } else if (event.key.key == SDLK_D) { CloseVirtualGamepad(); - } else if (event.key.key == SDLK_r && (event.key.mod & SDL_KMOD_CTRL)) { + } else if (event.key.key == SDLK_R && (event.key.mod & SDL_KMOD_CTRL)) { SDL_ReloadGamepadMappings(); } else if (event.key.key == SDLK_ESCAPE) { done = SDL_TRUE; } } else if (display_mode == CONTROLLER_MODE_BINDING) { - if (event.key.key == SDLK_c && (event.key.mod & SDL_KMOD_CTRL)) { + if (event.key.key == SDLK_C && (event.key.mod & SDL_KMOD_CTRL)) { if (binding_element == SDL_GAMEPAD_ELEMENT_NAME) { CopyControllerName(); } else { CopyMapping(); } - } else if (event.key.key == SDLK_v && (event.key.mod & SDL_KMOD_CTRL)) { + } else if (event.key.key == SDLK_V && (event.key.mod & SDL_KMOD_CTRL)) { if (binding_element == SDL_GAMEPAD_ELEMENT_NAME) { ClearControllerName(); PasteControllerName(); } else { PasteMapping(); } - } else if (event.key.key == SDLK_x && (event.key.mod & SDL_KMOD_CTRL)) { + } else if (event.key.key == SDLK_X && (event.key.mod & SDL_KMOD_CTRL)) { if (binding_element == SDL_GAMEPAD_ELEMENT_NAME) { CopyControllerName(); ClearControllerName(); diff --git a/test/testgl.c b/test/testgl.c index b79cd2aca..abbaa0743 100644 --- a/test/testgl.c +++ b/test/testgl.c @@ -391,10 +391,10 @@ int main(int argc, char *argv[]) while (SDL_PollEvent(&event)) { SDLTest_CommonEvent(state, &event, &done); if (event.type == SDL_EVENT_KEY_DOWN) { - if (event.key.key == SDLK_o) { + if (event.key.key == SDLK_O) { swap_interval--; update_swap_interval = SDL_TRUE; - } else if (event.key.key == SDLK_p) { + } else if (event.key.key == SDLK_P) { swap_interval++; update_swap_interval = SDL_TRUE; } diff --git a/test/testhittesting.c b/test/testhittesting.c index 6c5c26bcf..63e7e3d9c 100644 --- a/test/testhittesting.c +++ b/test/testhittesting.c @@ -139,7 +139,7 @@ int main(int argc, char **argv) case SDL_EVENT_KEY_DOWN: if (e.key.key == SDLK_ESCAPE) { done = 1; - } else if (e.key.key == SDLK_x) { + } else if (e.key.key == SDLK_X) { if (!areas) { areas = drag_areas; numareas = SDL_arraysize(drag_areas); diff --git a/test/testintersections.c b/test/testintersections.c index 9e62b9cea..2ff5f09d1 100644 --- a/test/testintersections.c +++ b/test/testintersections.c @@ -226,7 +226,7 @@ static void loop(void *arg) break; case SDL_EVENT_KEY_DOWN: switch (event.key.key) { - case SDLK_l: + case SDLK_L: if (event.key.mod & SDL_KMOD_SHIFT) { num_lines = 0; } else { @@ -237,7 +237,7 @@ static void loop(void *arg) (float)SDL_rand(480)); } break; - case SDLK_r: + case SDLK_R: if (event.key.mod & SDL_KMOD_SHIFT) { num_rects = 0; } else { diff --git a/test/testmodal.c b/test/testmodal.c index 9851551f4..f4e2fc4bb 100644 --- a/test/testmodal.c +++ b/test/testmodal.c @@ -91,14 +91,14 @@ int main(int argc, char *argv[]) w1 = NULL; } } else if (e.type == SDL_EVENT_KEY_DOWN) { - if ((e.key.key == SDLK_m || e.key.key == SDLK_n) && !w2) { + if ((e.key.key == SDLK_M || e.key.key == SDLK_N) && !w2) { if (SDL_CreateWindowAndRenderer("Non-Modal Window", 320, 200, SDL_WINDOW_HIDDEN, &w2, &r2) < 0) { SDL_Log("Failed to create modal window and/or renderer: %s\n", SDL_GetError()); exit_code = 1; goto sdl_quit; } - if (e.key.key == SDLK_m) { + if (e.key.key == SDLK_M) { if (!SDL_SetWindowModalFor(w2, w1)) { SDL_SetWindowTitle(w2, "Modal Window"); } @@ -108,7 +108,7 @@ int main(int argc, char *argv[]) SDL_DestroyWindow(w2); r2 = NULL; w2 = NULL; - } else if (e.key.key == SDLK_h) { + } else if (e.key.key == SDLK_H) { if (e.key.mod & SDL_KMOD_CTRL) { /* Hide the parent, which should hide the modal too. */ show_deadline = SDL_GetTicksNS() + SDL_SECONDS_TO_NS(3); @@ -121,7 +121,7 @@ int main(int argc, char *argv[]) SDL_HideWindow(w2); } } - } else if (e.key.key == SDLK_p && w2) { + } else if (e.key.key == SDLK_P && w2) { if (SDL_GetWindowFlags(w2) & SDL_WINDOW_MODAL) { /* Unparent the window */ if (!SDL_SetWindowModalFor(w2, NULL)) { diff --git a/test/testmouse.c b/test/testmouse.c index 38e42ca4c..b26e7bad9 100644 --- a/test/testmouse.c +++ b/test/testmouse.c @@ -211,7 +211,7 @@ static void loop(void *arg) break; case SDL_EVENT_KEY_DOWN: - if (event.key.key == SDLK_c) { + if (event.key.key == SDLK_C) { int x, y, w, h; SDL_GetWindowPosition(window, &x, &y); SDL_GetWindowSize(window, &w, &h); diff --git a/test/testwm.c b/test/testwm.c index 0d454ccc5..dea9d94e7 100644 --- a/test/testwm.c +++ b/test/testwm.c @@ -189,7 +189,7 @@ static void loop(void) if (event.type == SDL_EVENT_KEY_UP) { SDL_bool updateCursor = SDL_FALSE; - if (event.key.key == SDLK_a) { + if (event.key.key == SDLK_A) { SDL_assert(!"Keyboard generated assert"); } else if (event.key.key == SDLK_LEFT) { --system_cursor;