Simple Directmedia Layer
at main 48 lines 1.3 kB view raw
1/* 2 Copyright (C) 1997-2024 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 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\n", SDL_GetError()); 39 exit(1); 40 } 41 for (scancode = 0; scancode < SDL_SCANCODE_COUNT; ++scancode) { 42 SDL_Log("Scancode #%d, \"%s\"\n", scancode, 43 SDL_GetScancodeName(scancode)); 44 } 45 SDL_Quit(); 46 SDLTest_CommonDestroyState(state); 47 return 0; 48}