Main Page | Modules | Data Structures | File List | Data Fields

SDL_eventmap

SDL_eventmap is a library to unify many kinds of input into a uniform event system. Mouse, keyboard, and joystick events are all completely supported, even keys that SDL cannot identify.

It is founded on SDLH_HashEvent, which converts an SDL_Event into a 32-bit hash. These hashes are then mapped to SDL_UserEvents. For instance, a joystick button, a mouse button or a key could all be mapped to the same SDL_UserEvent without hardcoding any values.

SDLH_HashEvent crunches an entire SDL_Event down to 32-bits by simplifying some information. For axis motion events, for example, the hash doesn't contain the exact axis location - just whether it's positive, negative, or centered. It does the same for mice.

Various levels of filtering are available to ignore potentially unimportant events like button-release events, or to filter out extraneous information like key modifiers. This can be important, if your program doesn't see any difference between enter and alt-enter, moving and click-dragging, etc.

An SDL_EventMap structure acts like a translator, being fed SDL_Events and pumping SDL_UserEvents onto the event queue. You can have several different events mapping to the same SDL_UserEvent code.


Generated on Tue Jun 22 16:25:25 2004 by doxygen 1.3.5