Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Latest commit

 

History

History
37 lines (30 loc) · 972 Bytes

testkeys.c

File metadata and controls

37 lines (30 loc) · 972 Bytes
 
Apr 8, 2011
Apr 8, 2011
1
2
3
4
5
6
7
8
9
10
11
/*
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely.
*/
Apr 26, 2001
Apr 26, 2001
12
Feb 7, 2008
Feb 7, 2008
13
/* Print out all the scancodes we have, just to verify them */
Apr 26, 2001
Apr 26, 2001
14
15
16
#include <stdio.h>
#include <ctype.h>
Oct 3, 2005
Oct 3, 2005
17
18
#include <stdlib.h>
#include <string.h>
Apr 26, 2001
Apr 26, 2001
19
20
21
#include "SDL.h"
Jul 10, 2006
Jul 10, 2006
22
23
int
main(int argc, char *argv[])
Apr 26, 2001
Apr 26, 2001
24
{
Feb 7, 2011
Feb 7, 2011
25
SDL_Scancode scancode;
Apr 26, 2001
Apr 26, 2001
26
Jul 10, 2006
Jul 10, 2006
27
28
29
30
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
exit(1);
}
Feb 7, 2008
Feb 7, 2008
31
32
33
for (scancode = 0; scancode < SDL_NUM_SCANCODES; ++scancode) {
printf("Scancode #%d, \"%s\"\n", scancode,
SDL_GetScancodeName(scancode));
Jul 10, 2006
Jul 10, 2006
34
35
36
}
SDL_Quit();
return (0);
Apr 26, 2001
Apr 26, 2001
37
}