Event
SDL event
Operations
- New
- Flush
- Free
- GetJAxis
- GetJButton
- GetJHat
- GetKey
- GetMButton
- GetMouseMotion
- GetMouseWheel
- GetTextInput
- GetType
- Has
- IsNull
- Peeps
- Poll
- Pump
- Push
- Registers
- State
- Wait
- WaitTimeout
Flush
Clear events from the event queue
function : Flush(type:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| type | Int | the type of event to be cleared |
GetJAxis
Get joystick axis event
method : public : GetJAxis() ~ JoyAxisEventReturn
| Type | Description |
|---|---|
| JoyAxisEvent | joystick axis event |
GetJButton
Get joystick button event
method : public : GetJButton() ~ JoyButtonEventReturn
| Type | Description |
|---|---|
| JoyButtonEvent | joystick button event |
GetJHat
Get joystick hat event
method : public : GetJHat() ~ JoyHatEventReturn
| Type | Description |
|---|---|
| JoyHatEvent | joystick hat event |
GetKey
Get keyboard event
method : public : GetKey() ~ KeyboardEventReturn
| Type | Description |
|---|---|
| KeyboardEvent | keyboard event |
GetMButton
Get mouse button event
method : public : GetMButton() ~ MouseButtonEventReturn
| Type | Description |
|---|---|
| MouseButtonEvent | mouse button event |
GetMouseMotion
Get mouse motion event
method : public : GetMouseMotion() ~ MouseMotionEventReturn
| Type | Description |
|---|---|
| MouseMotionEvent | mouse motion event |
GetMouseWheel
Get mouse wheel event
method : public : GetMouseWheel() ~ MouseWheelEventReturn
| Type | Description |
|---|---|
| MouseWheelEvent | mouse wheel event |
GetTextInput
Get text input event
method : public : GetTextInput() ~ TextInputEventReturn
| Type | Description |
|---|---|
| TextInputEvent | text input event |
Has
Check for the existence of certain event types in the event queue
function : Has(type:Int) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| type | Int | the type of event to be queried |
Return
| Type | Description |
|---|---|
| Bool | true if events matching type are present, false otherwise |
IsNull
Determines if the underlying SDL C-struct is NULL
method : public : IsNull() ~ BoolReturn
| Type | Description |
|---|---|
| Bool | true if NULL, false otherwise |
Peeps
Check the event queue for messages and optionally return them
method : public : Peeps(numevents:Int, action:EventAction, minType:Int, maxType:Int) ~ IntParameters
| 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 |
Return
| Type | Description |
|---|---|
| Int | number of events actually stored or a negative error code on failure |
Push
Add an event to the event queue
method : public : Push() ~ IntReturn
| 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. |
Registers
Allocate a set of user-defined events, and return the beginning event number for that set of events
function : Registers(numevents:Int) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| numevents | Int | the number of events to be allocated |
State
Allows you to set the state of processing certain events.
function : State(type:Int, state:Int) ~ IntParameters
| 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 |
Return
| Type | Description |
|---|---|
| Int | SDL_DISABLE or SDL_ENABLE, representing the processing state of the event before this function makes any changes to it |
Wait
Waits indefinitely for the next available event.
method : public : Wait() ~ IntReturn
| Type | Description |
|---|---|
| Int | 1, or 0 if there was an error while waiting for events |
WaitTimeout
Waits until the specified timeout (in milliseconds) for the next available event
method : public : WaitTimeout(timeout:Int) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| timeout | Int | The timeout (in milliseconds) to wait for next event |
Return
| Type | Description |
|---|---|
| Int | 1, or 0 if there was an error while waiting for events |