Atlas - testkeys.c

Home / ext / SDL / test Lines: 1 | Size: 1302 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)]
[FILE BEGIN]
1/* 2 Copyright (C) 1997-2025 Sam Lantinga <[email protected]> 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 21int 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} 49
[FILE END]
(C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.