[SDL] Homemade SDL getkey function - please help!
prefect_ at gmx.net
Sun Apr 27 01:07:05 PDT 2003
-----BEGIN PGP SIGNED MESSAGE-----
On Sunday 27 April 2003 09:34, Roy Pluschke wrote:
> The releasing of a key also also generates an SDL event.
> So what I do (and what I've seen in numerous other programs)
> is create an array of flags for the keys I'm interested in
> and set the flag for a keydown event and clear it for a keyup
> event. If a flag is set the key has been pressed and not released
> (is being held down) and your program can react accordingly
> -- hope this helps
Have a look at the SDL_GetKeyState() function. It does exactly this for you,
so you don't have to do it yourself.
> <rjplus at sunshine.net>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the SDL