Skip to main content

LensStudio:Ui.Event

Class

Base 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()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


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

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


isSame()

isSame(other): boolean

Returns true if this object refers to the same instance as the given object.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame