LensStudio:Ui.Event
ClassBase class for UI input events that can be accepted or ignored by handlers.
Index
Example
// Event is the base for UI events (KeyEvent, MouseEvent).
// accept() marks the event handled; ignore() lets it propagate.
const UiTest = await import('LensStudio:UiTest');
const { Key, KeyboardModifier } = await import('LensStudio:Ui');
const event = UiTest.KeyEvent(UiTest.EventType.KeyPress, Key.Key_A, KeyboardModifier.NoModifier, 'a');
event.accept();
console.log(`Event accepted: key=${event.key}`);
Extends
Extended by
Methods
accept()
accept():
void
Marks the event as handled so it will not propagate further.
Returns
void
getTypeName()
staticgetTypeName():string
Returns the type name of this class.
Returns
string
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
ignore()
ignore():
void
Marks the event as unhandled so it propagates to parent widgets.
Returns
void
isOfType()
isOfType(
type):boolean
Returns true if the object is of the specified type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object refers to the same instance as the given object.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean