Events
The events managed by the application are simplified by SDL to six basic types:
You can ignore each of these event types, but except for the window hook event, they are filtered and posted to an internal event queue.
Be careful of the code you put into the event filter function.
The event filter may be run concurrently in a separate thread from your main
code, and you should be aware of the various pitfalls of multi-threaded
programming when writing filter functions. In general, the cleanest way to
handle events is to read them from the event queue using
Event handling is started by calling Detailed examples can be found in the sample code. |