[SDL] Homemade SDL getkey function - please help!
Nicolai Haehnle
prefect_ at gmx.net
Sun Apr 27 01:07:05 PDT 2003
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
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.
cu,
Nicolai
> RJP
> <rjplus at sunshine.net>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE+q5A8sxPozBga0lwRAoOSAKDQRKotiAlMgrIow45InJRb8zm6bACgpqDz
OFbftUR7CRrm1InslMMekGE=
=B4V/
-----END PGP SIGNATURE-----
More information about the SDL
mailing list