Skip to main content
Provides access to the context that triggered a listener action. 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

isPointerEvent() -> boolean
Returns true if the action was triggered by a pointer event.

isKeyboardEvent

isKeyboardEvent() -> boolean
Returns true if the action was triggered by a keyboard event.

isTextInput

isTextInput() -> boolean
Returns true if the action was triggered by a text input event.

isFocus

isFocus() -> boolean
Returns true if the action was triggered by a focus change.

isReportedEvent

isReportedEvent() -> boolean
Returns true if the action was triggered by a reported Rive event.

isViewModelChange

isViewModelChange() -> boolean
Returns true if the action was triggered by a view model change.

isNone

isNone() -> boolean
Returns true if the action was triggered by an unknown or unsupported event type.

asPointerEvent

asPointerEvent() -> PointerEvent?
Returns the pointer event if applicable, otherwise nil.

asKeyboardEvent

asKeyboardEvent() -> KeyboardEvent?
Returns the keyboard event if applicable, otherwise nil.

asTextInput

asTextInput() -> TextInput?
Returns the text input event if applicable, otherwise nil.

asFocus

asFocus() -> FocusEvent?
Returns the focus event if applicable, otherwise nil.

asReportedEvent

asReportedEvent() -> ReportedEvent?
Returns the reported event if applicable, otherwise nil.

asViewModelChange

asViewModelChange() -> ViewModelChange?
Returns the view model change if applicable, otherwise nil.

asNone

asNone() -> NoneEvent?
Returns a none event if applicable, otherwise nil.