|
| 1 | +--- |
| 2 | +title: ListenerContext |
| 3 | +--- |
| 4 | + |
| 5 | +Represents the context of a listener perform action |
| 6 | + |
| 7 | + |
| 8 | +## Methods |
| 9 | + |
| 10 | +### `isPointerEvent` |
| 11 | + |
| 12 | +{/* isPointerEvent: (self: ListenerContext) -> boolean */} |
| 13 | +<div class="signature"> |
| 14 | +```lua |
| 15 | +isPointerEvent() -> boolean |
| 16 | +``` |
| 17 | +</div> |
| 18 | + |
| 19 | +returns true if the perform action was invoked through a pointer event |
| 20 | + |
| 21 | + |
| 22 | +### `isKeyboardEvent` |
| 23 | + |
| 24 | +{/* isKeyboardEvent: (self: ListenerContext) -> boolean */} |
| 25 | +<div class="signature"> |
| 26 | +```lua |
| 27 | +isKeyboardEvent() -> boolean |
| 28 | +``` |
| 29 | +</div> |
| 30 | + |
| 31 | +returns true if the perform action was invoked through a keyboard event |
| 32 | + |
| 33 | + |
| 34 | +### `isTextInput` |
| 35 | + |
| 36 | +{/* isTextInput: (self: ListenerContext) -> boolean */} |
| 37 | +<div class="signature"> |
| 38 | +```lua |
| 39 | +isTextInput() -> boolean |
| 40 | +``` |
| 41 | +</div> |
| 42 | + |
| 43 | +returns true if the perform action was invoked through a text input |
| 44 | + |
| 45 | + |
| 46 | +### `isFocus` |
| 47 | + |
| 48 | +{/* isFocus: (self: ListenerContext) -> boolean */} |
| 49 | +<div class="signature"> |
| 50 | +```lua |
| 51 | +isFocus() -> boolean |
| 52 | +``` |
| 53 | +</div> |
| 54 | + |
| 55 | +returns true if the perform action was invoked through a focus change |
| 56 | + |
| 57 | + |
| 58 | +### `isReportedEvent` |
| 59 | + |
| 60 | +{/* isReportedEvent: (self: ListenerContext) -> boolean */} |
| 61 | +<div class="signature"> |
| 62 | +```lua |
| 63 | +isReportedEvent() -> boolean |
| 64 | +``` |
| 65 | +</div> |
| 66 | + |
| 67 | +returns true if the perform action was invoked through a Rive event |
| 68 | + |
| 69 | + |
| 70 | +### `isViewModelChange` |
| 71 | + |
| 72 | +{/* isViewModelChange: (self: ListenerContext) -> boolean */} |
| 73 | +<div class="signature"> |
| 74 | +```lua |
| 75 | +isViewModelChange() -> boolean |
| 76 | +``` |
| 77 | +</div> |
| 78 | + |
| 79 | +returns true if the perform action was invoked through a view model change |
| 80 | + |
| 81 | + |
| 82 | +### `isNone` |
| 83 | + |
| 84 | +{/* isNone: (self: ListenerContext) -> boolean */} |
| 85 | +<div class="signature"> |
| 86 | +```lua |
| 87 | +isNone() -> boolean |
| 88 | +``` |
| 89 | +</div> |
| 90 | + |
| 91 | +returns true if the perform action is none of the known types |
| 92 | + |
| 93 | + |
| 94 | +### `asPointerEvent` |
| 95 | + |
| 96 | +{/* asPointerEvent: (self: ListenerContext) -> PointerEvent? */} |
| 97 | +<div class="signature"> |
| 98 | +```lua |
| 99 | +asPointerEvent() -> PointerEvent? |
| 100 | +``` |
| 101 | +</div> |
| 102 | + |
| 103 | +returns a pointer event if context is of type pointer event, null otherwise |
| 104 | + |
| 105 | + |
| 106 | +### `asKeyboardEvent` |
| 107 | + |
| 108 | +{/* asKeyboardEvent: (self: ListenerContext) -> KeyboardEvent? */} |
| 109 | +<div class="signature"> |
| 110 | +```lua |
| 111 | +asKeyboardEvent() -> KeyboardEvent? |
| 112 | +``` |
| 113 | +</div> |
| 114 | + |
| 115 | +returns a keyboard event if context is of type keyboard event, null otherwise |
| 116 | + |
| 117 | + |
| 118 | +### `asTextInput` |
| 119 | + |
| 120 | +{/* asTextInput: (self: ListenerContext) -> TextInput? */} |
| 121 | +<div class="signature"> |
| 122 | +```lua |
| 123 | +asTextInput() -> TextInput? |
| 124 | +``` |
| 125 | +</div> |
| 126 | + |
| 127 | +returns a text input event if context is of type text input event, null otherwise |
| 128 | + |
| 129 | + |
| 130 | +### `asFocus` |
| 131 | + |
| 132 | +{/* asFocus: (self: ListenerContext) -> FocusEvent? */} |
| 133 | +<div class="signature"> |
| 134 | +```lua |
| 135 | +asFocus() -> FocusEvent? |
| 136 | +``` |
| 137 | +</div> |
| 138 | + |
| 139 | +returns a focus event event if context is of type focus event, null otherwise |
| 140 | + |
| 141 | + |
| 142 | +### `asReportedEvent` |
| 143 | + |
| 144 | +{/* asReportedEvent: (self: ListenerContext) -> ReportedEvent? */} |
| 145 | +<div class="signature"> |
| 146 | +```lua |
| 147 | +asReportedEvent() -> ReportedEvent? |
| 148 | +``` |
| 149 | +</div> |
| 150 | + |
| 151 | +returns a reported event if context is of type reported evnet, null otherwise |
| 152 | + |
| 153 | + |
| 154 | +### `asViewModelChange` |
| 155 | + |
| 156 | +{/* asViewModelChange: (self: ListenerContext) -> ViewModelChange? */} |
| 157 | +<div class="signature"> |
| 158 | +```lua |
| 159 | +asViewModelChange() -> ViewModelChange? |
| 160 | +``` |
| 161 | +</div> |
| 162 | + |
| 163 | +returns a view model change if context is of type view model, null otherwise |
| 164 | + |
| 165 | + |
| 166 | +### `asNone` |
| 167 | + |
| 168 | +{/* asNone: (self: ListenerContext) -> NoneEvent? */} |
| 169 | +<div class="signature"> |
| 170 | +```lua |
| 171 | +asNone() -> NoneEvent? |
| 172 | +``` |
| 173 | +</div> |
| 174 | + |
| 175 | +returns a noop event if context is of type none, null otherwise |
| 176 | + |
| 177 | + |
0 commit comments