test/testkeys.c
author Holmes Futrell <hfutrell@umail.ucsb.edu>
Thu, 01 Jan 2009 23:49:28 +0000
changeset 2950 04c9f1e4c496
parent 2306 1a8bab15a45d
child 5081 25d4feb7c127
permissions -rw-r--r--
Added target testdraw2 for running the test/testdraw2.c test.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     1
2306
1a8bab15a45d Fixed compile errors
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
     2
/* Print out all the scancodes we have, just to verify them */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     3
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     4
#include <stdio.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     5
#include <ctype.h>
1154
d93862a3d821 Fixed compiler warnings in Watcom C.
Ryan C. Gordon <icculus@icculus.org>
parents: 0
diff changeset
     6
#include <stdlib.h>
d93862a3d821 Fixed compiler warnings in Watcom C.
Ryan C. Gordon <icculus@icculus.org>
parents: 0
diff changeset
     7
#include <string.h>
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     8
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     9
#include "SDL.h"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    10
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1154
diff changeset
    11
int
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1154
diff changeset
    12
main(int argc, char *argv[])
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    13
{
2306
1a8bab15a45d Fixed compile errors
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
    14
    SDL_scancode scancode;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    15
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1154
diff changeset
    16
    if (SDL_Init(SDL_INIT_VIDEO) < 0) {
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1154
diff changeset
    17
        fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1154
diff changeset
    18
        exit(1);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1154
diff changeset
    19
    }
2306
1a8bab15a45d Fixed compile errors
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
    20
    for (scancode = 0; scancode < SDL_NUM_SCANCODES; ++scancode) {
1a8bab15a45d Fixed compile errors
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
    21
        printf("Scancode #%d, \"%s\"\n", scancode,
1a8bab15a45d Fixed compile errors
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
    22
               SDL_GetScancodeName(scancode));
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1154
diff changeset
    23
    }
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1154
diff changeset
    24
    SDL_Quit();
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1154
diff changeset
    25
    return (0);
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    26
}