4 >SDL_GetKeyState
</TITLE
7 CONTENT=
"Modular DocBook HTML Stylesheet Version 1.76b+
10 TITLE=
"SDL Library Documentation"
11 HREF=
"index.html"><LINK
13 TITLE=
"Event Functions."
14 HREF=
"eventfunctions.html"><LINK
16 TITLE=
"SDL_EventState"
17 HREF=
"sdleventstate.html"><LINK
19 TITLE=
"SDL_GetModState"
20 HREF=
"sdlgetmodstate.html"></HEAD
31 SUMMARY=
"Header navigation table"
40 >SDL Library Documentation
</TH
48 HREF=
"sdleventstate.html"
62 HREF=
"sdlgetmodstate.html"
83 >SDL_GetKeyState
--
Get a snapshot of the current keyboard state
</DIV
85 CLASS=
"REFSYNOPSISDIV"
99 CLASS=
"FUNCSYNOPSISINFO"
100 >#include
"SDL.h"</PRE
109 >(int *numkeys);
</CODE
123 >Gets a snapshot of the current keyboard state. The current state is return as a pointer to an array, the size of this array is stored in
<TT
128 >. The array is indexed by the
<A
134 > symbols. A value of
1 means the key is pressed and a value of
0 means its not. The pointer returned is a pointer to an internal SDL array and should not be freed by the caller.
</P
143 HREF=
"sdlpumpevents.html"
148 > to update the state array.
</P
161 CLASS=
"PROGRAMLISTING"
162 >Uint8 *keystate = SDL_GetKeyState(NULL);
163 if ( keystate[SDLK_RETURN] ) printf(
"Return Key Pressed.\n");
</PRE
182 HREF=
"sdlpumpevents.html"
194 SUMMARY=
"Footer navigation table"
205 HREF=
"sdleventstate.html"
223 HREF=
"sdlgetmodstate.html"
239 HREF=
"eventfunctions.html"