1SDL_GetKeyState(3)             SDL API Reference            SDL_GetKeyState(3)
2
3
4

NAME

6       SDL_GetKeyState- Get a snapshot of the current keyboard state
7

SYNOPSIS

9       #include "SDL.h"
10
11       Uint8 *SDL_GetKeyState(int *numkeys);
12

DESCRIPTION

14       Gets  a  snapshot  of  the current keyboard state. The current state is
15       return as a pointer to an array, the size of this array  is  stored  in
16       numkeys. The array is indexed by the SDLK_* symbols. A value of 1 means
17       the key is pressed and a value of 0 means its not. The pointer returned
18       is  a  pointer  to an internal SDL array and should not be freed by the
19       caller.
20
21              Note:
22
23              Use SDL_PumpEvents to update the state array.
24

EXAMPLE

26       Uint8 *keystate = SDL_GetKeyState(NULL);
27       if ( keystate[SDLK_RETURN] ) printf("Return Key Pressed.
28       ");
29

SEE ALSO

31       SDL Key Symbols, SDL_PumpEvents
32
33
34
35SDL                         Tue 11 Sep 2001, 22:59          SDL_GetKeyState(3)
Impressum