#include <sdlmm_event.h>
Public Methods | |
bool | Poll (bool fetch=true) |
Polls for currently pending events. More... | |
bool | Wait (bool fetch=true) |
Waits indefinitely for the next available event. More... | |
bool | Push () |
Push this event onto the event queue. More... | |
Static Public Methods | |
Event Methods | |
void | PumpEvents () |
Pumps the event loop, gathering events from the input devices. More... | |
void | SetEventFilter (SDL_EventFilter filter) |
Sets up a filter to process all events before they are posted to the event queue. More... | |
SDL_EventFilter | GetEventFilter () |
Retrieves a pointer to the event filter. More... | |
Uint8 | EventState (Uint8 type, int state) |
Set the state of processing for certain events. More... | |
void | HandleEvents (EventHandler &handler) |
Handle all queued events using the specified EventHandler. More... | |
void | HandleEvent (EventHandler &handler, const SDL_Event &event) |
Handle a single event using the specified EventHandler. More... | |
Keyboard Methods | |
Uint8* | GetKeyState (int &numkeys) |
Get a snapshot of the current keyboard state. More... | |
Uint8* | GetKeyState () |
Get a snapshot of the current keyboard state. More... | |
SDLMod | GetModState () |
Get the state of modifier keys. More... | |
void | SetModState (SDLMod modstate) |
Set the current key modifier state. More... | |
char* | GetKeyName (SDLKey key) |
Get the name of an SDL virtual key symbol. More... | |
bool | EnableUNICODE (bool enable=true) |
Enable UNICODE keyboard translation. More... | |
bool | DisableUNICODE () |
Disable UNICODE translation. More... | |
bool | QueryUNICODE () |
Query the current UNICODE translation mode. More... | |
bool | EnableKeyRepeat (int delay=SDL_DEFAULT_REPEAT_DELAY, int interval=SDL_DEFAULT_REPEAT_DELAY) |
Set keyboard repeat rate. More... | |
Mouse Methods | |
Uint8 | GetMouseState (int *x=0, int *y=0) |
Retrieve the current state of the mouse. More... | |
Uint8 | GetRelativeMouseState (int *x, int *y) |
Retrieve the current state of the mouse. More... | |
Other Methods | |
Uint8 | GetAppState () |
Get the state of the application. More... | |
int | JoystickEventState (int state) |
Enable / disable joystick event polling. More... | |
Public Attributes | |
SDL_Event | me |
The event structure. More... |
The Event class is the core to all event handling is SDLmm. It's probably the most important class after Surface. The Event class can be used to store any type of event.
Definition at line 32 of file sdlmm_event.h.
|
Disable UNICODE translation.
Definition at line 298 of file sdlmm_event.h. |
|
Set keyboard repeat rate. Enables or disables the keyboard repeat rate. delay specifies how long the key must be pressed before it begins repeating. It then repeats at the speed specified by interval. Both delay and interval are expressed in milliseconds. Setting delay to 0 disables key repeating completely. If called without parameters, the default values uses are SDL_DEFAULT_REPEAT_DELAY and SDL_DEFAULT_REPEAT_INTERVAL.
Definition at line 86 of file sdlmm_event.cpp. |
|
Enable UNICODE keyboard translation. If you wish to translate a keysym to it's printable representation, you need to enable UNICODE translation using this function and then look in the unicode member of the SDL_keysym structure. This value will be zero for keysyms that do not have a printable representation. UNICODE translation is disabled by default as the conversion can cause a slight overhead.
Definition at line 290 of file sdlmm_event.h. |
|
Set the state of processing for certain events. This function allows you to set the state of processing certain event types. If state is set to SDL_IGNORE, that event type will be automatically dropped from the event queue and will not be filtered. If state is set to SDL_ENABLE, that event type will be processed normally. If state is set to SDL_QUERY, EventState() will return the current processing state of the specified event type. A list of event types can be found in the SDL_Event section in the SDL documentation.
Definition at line 62 of file sdlmm_event.cpp. |
|
Get the state of the application. This function returns the current state of the application. The value returned is a bitwise combination of:
Definition at line 97 of file sdlmm_event.cpp. |
|
Retrieves a pointer to the event filter. This function retrieves a pointer to the event filter that was previously set using SetEventFilter(). An SDL_EventFilter function is defined as:
typedef int (*SDL_EventFilter)(const SDL_Event *event);
Definition at line 58 of file sdlmm_event.cpp. |
|
Get the name of an SDL virtual key symbol.
Definition at line 78 of file sdlmm_event.cpp. |
|
Get a snapshot of the current keyboard state. Same as the GetKeyState(int &numkeys) method, used when you don't care how many keys were returned (i.e you want to check the state of a key that is known to exist).
Definition at line 70 of file sdlmm_event.cpp. |
|
Get a snapshot of the current keyboard state. Gets a snapshot of the current keyboard state. The current state is returned as a pointer to an array. The size of this array is stored in numkeys. The array is indexed by the SDLK_* symbols. A value of 1 means the key is pressed and a value of 0 means its not.
Definition at line 66 of file sdlmm_event.cpp. |
|
Get the state of modifier keys. Returns the current of the modifier keys (CTRL, ALT, etc.).
Definition at line 74 of file sdlmm_event.cpp. |
|
Retrieve the current state of the mouse. The current button state is returned as a button bitmask, which can be tested using the SDL_BUTTON(X) macros, and x and y are set to the current mouse cursor position. You can pass zero for either x or y.
Definition at line 90 of file sdlmm_event.cpp. |
|
Retrieve the current state of the mouse. The current button state is returned as a button bitmask, which can be tested using the SDL_BUTTON(X) macros, and x and y are set to the change in the mouse position since the last call to SDL_GetRelativeMouseState or since event initialization. You can pass zero for either x or y.
Definition at line 94 of file sdlmm_event.cpp. |
|
Handle a single event using the specified EventHandler. This function calls the event callback methods. To actually handle any events, you need to create a derivate of the EventHandler class reimplementing the callbacks for the events you're interested in. See the EventHandler documentation for more details.
Definition at line 111 of file sdlmm_event.cpp. Referenced by HandleEvents().
|
|
Handle all queued events using the specified EventHandler. This function polls for active events and calls the event callback methods. To actually handle any events, you need to create a derivate of the EventHandler class reimplementing the callbacks for the events you're interested in. See the EventHandler documentation for more details.
Definition at line 104 of file sdlmm_event.cpp. |
|
Enable / disable joystick event polling.
Definition at line 100 of file sdlmm_event.cpp. |
|
Polls for currently pending events. If there are any pending events, it will by default be removed from the queue and stored in this class instance.
Definition at line 30 of file sdlmm_event.cpp. |
|
Pumps the event loop, gathering events from the input devices. PumpEvents() gathers all the pending input information from devices and places it on the event queue. Without calls to PumpEvents() no events would ever be placed on the queue. Often the calls to PumpEvents() is hidden from the user since Poll and Wait implicitly call Pump. However, if you are not polling or waiting for events (e.g. your filtering them), then you must call Pump to force an event queue update.
Definition at line 50 of file sdlmm_event.cpp. |
|
Push this event onto the event queue. The event queue can actually be used as a two way communication channel. Not only can events be read from the queue, but the user can also push their own events onto it.
Definition at line 46 of file sdlmm_event.cpp. |
|
Query the current UNICODE translation mode. This function checks whether UNICODE translation is enabled or disabled.
Definition at line 307 of file sdlmm_event.h. |
|
Sets up a filter to process all events before they are posted to the event queue. This function sets up a filter to process all events before they are posted to the event queue. This is a very powerful and flexible feature. The filter is prototyped as:
typedef int (*SDL_EventFilter)(const SDL_Event *event); If the filter returns 1, then the event will be added to the internal queue. If it returns 0, then the event will be dropped from the queue. This allows selective filtering of dynamically. There is one caveat when dealing with the SDL_QUITEVENT event type. The event filter is only called when the window manager desires to close the application window. If the event filter returns 1, then the window will be closed, otherwise the window will remain open if possible. If the quit event is generated by an interrupt signal, it will bypass the internal queue and be delivered to the application at the next event poll.
Definition at line 54 of file sdlmm_event.cpp. |
|
Set the current key modifier state. The inverse of GetModState(), SetModState() allows you to impose modifier key states on your application. Simply pass your desired modifier states into modstate. This value my be a logical OR'd combination of the symbols documented in GetModState().
Definition at line 82 of file sdlmm_event.cpp. |
|
Waits indefinitely for the next available event. This function will wait for an event to become available. It will not return until an event is queued.
Definition at line 38 of file sdlmm_event.cpp. |
|
The event structure. If you use the event polling method, this is where the result is stored. You should consider using the more elegant EventHandler method instead however.
Definition at line 41 of file sdlmm_event.h. |
Documentation automatically generated by written by Dimitri van Heesch. | Project hosted at |