Skip to main content
Provides access to the context that triggered a listener action. (Coming soon) A ListenerContext can represent different event types (pointer, keyboard, text input, focus, view model changes, or reported events). Use the is... methods to check the type, and the corresponding as... methods to retrieve the event data.

Methods

isPointerEvent

Returns true if the action was triggered by a pointer event.

isKeyboardEvent

Returns true if the action was triggered by a keyboard event.

isTextInput

Returns true if the action was triggered by a text input event.

isFocus

Returns true if the action was triggered by a focus change.

isReportedEvent

Returns true if the action was triggered by a reported Rive event.

isViewModelChange

Returns true if the action was triggered by a view model change.

isGamepadConnected

isGamepadEvent

isGamepadDisconnected

isNone

Returns true if the action was triggered by an unknown or unsupported event type.

asPointerEvent

Returns the pointer event if applicable, otherwise nil.

asKeyboardEvent

Returns the keyboard event if applicable, otherwise nil.

asTextInput

Returns the text input event if applicable, otherwise nil.

asFocus

Returns the focus event if applicable, otherwise nil.

asReportedEvent

Returns the reported event if applicable, otherwise nil.

asViewModelChange

Returns the view model change if applicable, otherwise nil.

asGamepadConnected

asGamepadEvent

asGamepadDisconnected

asNone

Returns a none event if applicable, otherwise nil.