[SDL] SDL event behavior

Nicolai Haehnle prefect_ at gmx.net
Tue Jan 14 07:00:02 PST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 14 January 2003 11:15, Michael Alger wrote:
> The usual way of handling input for games is to disable key repeating,
> and just catch the KEYDOWN/KEYUP event and use a flag to keep track of
> the state of the key.   You then do the sprite movement outside of the
> event handler code based on what controls are currently being applied.
>
> Typically, this is done using a bitfield to save memory.

Note that SDL already does this for you. Check out the function 
SDL_GetKeyState().

cu,
Nicolai
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+JCZKsxPozBga0lwRAs58AJ45Aeukd4NgvsRmv++PsWf595petgCfcW3i
lclxCy5fCy0i3AmZqH/qwwY=
=ihzp
-----END PGP SIGNATURE-----





More information about the SDL mailing list