SDL event
OperationsCreate a new event instance
New()
Clear events from the event queue
function : Flush(type:Int) ~ Nil
Name | Type | Description |
---|---|---|
type | Int | the type of event to be cleared |
Frees the event
method : public : Free() ~ Nil
Get joystick axis event
method : public : GetJAxis() ~ JoyAxisEvent
Type | Description |
---|---|
JoyAxisEvent | joystick axis event |
Get joystick button event
method : public : GetJButton() ~ JoyButtonEvent
Type | Description |
---|---|
JoyButtonEvent | joystick button event |
Get joystick hat event
method : public : GetJHat() ~ JoyHatEvent
Type | Description |
---|---|
JoyHatEvent | joystick hat event |
Get keyboard event
method : public : GetKey() ~ KeyboardEvent
Type | Description |
---|---|
KeyboardEvent | keyboard event |
Get mouse button event
method : public : GetMButton() ~ MouseButtonEvent
Type | Description |
---|---|
MouseButtonEvent | mouse button event |
Get mouse motion event
method : public : GetMouseMotion() ~ MouseMotionEvent
Type | Description |
---|---|
MouseMotionEvent | mouse motion event |
Get mouse wheel event
method : public : GetMouseWheel() ~ MouseWheelEvent
Type | Description |
---|---|
MouseWheelEvent | mouse wheel event |
Get text input event
method : public : GetTextInput() ~ TextInputEvent
Type | Description |
---|---|
TextInputEvent | text input event |
Event type
method : public : GetType() ~ EventType
Type | Description |
---|---|
EventType | type |
Check for the existence of certain event types in the event queue
function : Has(type:Int) ~ Bool
Name | Type | Description |
---|---|---|
type | Int | the type of event to be queried |
Type | Description |
---|---|
Bool | true if events matching type are present, false otherwise |
Determines if the underlying SDL C-struct is NULL
method : public : IsNull() ~ Bool
Type | Description |
---|---|
Bool | true if NULL, false otherwise |
Check the event queue for messages and optionally return them
method : public : Peeps(numevents:Int, action:EventAction, minType:Int, maxType:Int) ~ Int
Name | Type | Description |
---|---|---|
numevents | Int | if action is SDL_ADDEVENT, the number of events to add back to the event queue; if action is SDL_PEEKEVENT or SDL_GETEVENT, the maximum number of events to retrieve |
action | EventAction | action to take; see Remarks for details |
minType | Int | minimum value of the event type to be considered; SDL_FIRSTEVENT is a safe choice |
maxType | Int | maximum value of the event type to be considered; SDL_LASTEVENT is a safe choice |
Type | Description |
---|---|
Int | number of events actually stored or a negative error code on failure |
Poll for currently pending events
method : public : Poll() ~ Int
Pump the event loop, gathering events from the input devices
function : Pump() ~ Nil
Add an event to the event queue
method : public : Push() ~ Int
Type | Description |
---|---|
Int | 1 on success, 0 if the event was filtered, or -1 if the event queue was full or there was some other error. |
Allocate a set of user-defined events, and return the beginning event number for that set of events
function : Registers(numevents:Int) ~ Int
Name | Type | Description |
---|---|---|
numevents | Int | the number of events to be allocated |
Allows you to set the state of processing certain events.
function : State(type:Int, state:Int) ~ Int
Name | Type | Description |
---|---|---|
type | Int | the type of event; see SDL_EventType for details |
state | Int | how to process the event; see Remarks for details |
Type | Description |
---|---|
Int | SDL_DISABLE or SDL_ENABLE, representing the processing state of the event before this function makes any changes to it |
Waits indefinitely for the next available event.
method : public : Wait() ~ Int
Type | Description |
---|---|
Int | 1, or 0 if there was an error while waiting for events |
Waits until the specified timeout (in milliseconds) for the next available event
method : public : WaitTimeout(timeout:Int) ~ Int
Name | Type | Description |
---|---|---|
timeout | Int | The timeout (in milliseconds) to wait for next event |
Type | Description |
---|---|
Int | 1, or 0 if there was an error while waiting for events |