|
NAMESDLmm::Event - The general Event class.SYNOPSIS#include <sdlmm_event.h> Public Methodsbool Poll (bool fetch=true) Polls for currently pending events. bool Wait (bool fetch=true) Waits indefinitely for the next available event. bool Push () Push this event onto the event queue. Static Public MethodsEvent Methods
Keyboard Methods
Mouse Methods
Other Methods
Public AttributesSDL_Event me The event structure. DETAILED DESCRIPTIONThe general Event class.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. MEMBER FUNCTION DOCUMENTATIONbool SDLmm::Event::DisableUNICODE () [inline, static]Disable UNICODE translation.Returns:
See also:
bool SDLmm::Event::EnableKeyRepeat (int delay = SDL_DEFAULT_REPEAT_DELAY, int interval = SDL_DEFAULT_REPEAT_DELAY) [static]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. Returns:
Parameters:
bool SDLmm::Event::EnableUNICODE (bool enable = true) [inline, static]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. Parameters:
Returns:
See also:
Uint8 SDLmm::Event::EventState (Uint8 type, int state) [static]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. Parameters:
Returns:
Uint8 SDLmm::Event::GetAppState () [static]Get the state of the application.This function returns the current state of the application. The value returned is a bitwise combination of:
Returns:
SDL_EventFilter SDLmm::Event::GetEventFilter () [static]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); Returns:
See also:
char * SDLmm::Event::GetKeyName (SDLKey key) [static]Get the name of an SDL virtual key symbol.Returns:
Parameters:
Uint8 * SDLmm::Event::GetKeyState () [static]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). Example:
Uint8 *keystate; keystate = Event::GetKeyState(); if (keystate[SDLK_RETURN]) cout << 'Return Key Pressed.0; See also:
Uint8 * SDLmm::Event::GetKeyState (int & numkeys) [static]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. Note:
See also:
Parameters:
SDLMod SDLmm::Event::GetModState () [static]Get the state of modifier keys.Returns the current of the modifier keys (CTRL, ALT, etc.). Returns:
See also:
Uint8 SDLmm::Event::GetMouseState (int * x = 0, int * y = 0) [static]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. Returns:
Parameters:
Uint8 SDLmm::Event::GetRelativeMouseState (int * x, int * y) [static]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. Returns:
Parameters:
void SDLmm::Event::HandleEvents (EventHandler & handler) [static]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. Parameters:
See also:
int SDLmm::Event::JoystickEventState (int state) [static]Enable / disable joystick event polling.bool SDLmm::Event::Poll (bool fetch = true)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. Parameters:
Returns:
See also:
void SDLmm::Event::PumpEvents () [static]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. Note:
bool SDLmm::Event::Push ()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. Note:
Warning:
Returns:
bool SDLmm::Event::QueryUNICODE () [inline, static]Query the current UNICODE translation mode.This function checks whether UNICODE translation is enabled or disabled. Returns:
See also:
void SDLmm::Event::SetEventFilter (SDL_EventFilter filter) [static]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. Note:
Warning:
See also:
void SDLmm::Event::SetModState (SDLMod modstate) [static]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(). Parameters:
See also:
bool SDLmm::Event::Wait (bool fetch = true)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. Parameters:
Returns:
See also:
MEMBER DATA DOCUMENTATIONSDL_Event SDLmm::Event::meThe 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. See also:
AUTHORGenerated automatically by Doxygen for SDLmm from the source code.
Visit the GSP FreeBSD Man Page Interface. |