diff options
Diffstat (limited to 'src/contrib/SDL-3.2.20/test/testkeys.c')
-rw-r--r-- | src/contrib/SDL-3.2.20/test/testkeys.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/contrib/SDL-3.2.20/test/testkeys.c b/src/contrib/SDL-3.2.20/test/testkeys.c new file mode 100644 index 0000000..c773384 --- /dev/null +++ b/src/contrib/SDL-3.2.20/test/testkeys.c | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> | ||
3 | |||
4 | This software is provided 'as-is', without any express or implied | ||
5 | warranty. In no event will the authors be held liable for any damages | ||
6 | arising from the use of this software. | ||
7 | |||
8 | Permission is granted to anyone to use this software for any purpose, | ||
9 | including commercial applications, and to alter it and redistribute it | ||
10 | freely. | ||
11 | */ | ||
12 | |||
13 | /* Print out all the scancodes we have, just to verify them */ | ||
14 | |||
15 | #include <stdlib.h> | ||
16 | |||
17 | #include <SDL3/SDL.h> | ||
18 | #include <SDL3/SDL_main.h> | ||
19 | #include <SDL3/SDL_test.h> | ||
20 | |||
21 | int main(int argc, char *argv[]) | ||
22 | { | ||
23 | SDL_Scancode scancode; | ||
24 | SDLTest_CommonState *state; | ||
25 | |||
26 | /* Initialize test framework */ | ||
27 | state = SDLTest_CommonCreateState(argv, 0); | ||
28 | if (!state) { | ||
29 | return 1; | ||
30 | } | ||
31 | |||
32 | /* Parse commandline */ | ||
33 | if (!SDLTest_CommonDefaultArgs(state, argc, argv)) { | ||
34 | return 1; | ||
35 | } | ||
36 | |||
37 | if (!SDL_Init(SDL_INIT_VIDEO)) { | ||
38 | SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s", SDL_GetError()); | ||
39 | exit(1); | ||
40 | } | ||
41 | for (scancode = 0; scancode < SDL_SCANCODE_COUNT; ++scancode) { | ||
42 | SDL_Log("Scancode #%d, \"%s\"", scancode, | ||
43 | SDL_GetScancodeName(scancode)); | ||
44 | } | ||
45 | SDL_Quit(); | ||
46 | SDLTest_CommonDestroyState(state); | ||
47 | return 0; | ||
48 | } | ||