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.
This commit is contained in:
parent
d9dc4b320a
commit
e8dbbf8380
16 changed files with 275 additions and 93 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue