Preparing search index...

    Input event describing a keyboard key press, including key code, modifiers, and text.

        const UiTest = await import('LensStudio:UiTest');
    const { Key, KeyboardModifier } = await import('LensStudio:Ui');

    const ctrlA = UiTest.KeyEvent(
    UiTest.EventType.KeyPress,
    Key.Key_A,
    KeyboardModifier.ControlModifier,
    'a',
    );
    console.log(`KeyEvent: key=${ctrlA.key} modifiers=${ctrlA.modifiers} text="${ctrlA.text}"`);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    key: Key

    Key code identifying which key triggered the event.

    modifiers: KeyboardModifier

    Bitmask of keyboard modifiers (Shift, Ctrl, Alt, Meta) active when the key was pressed.

    text: string

    Unicode text produced by the key press, if any.

    Methods

    • Marks the event as handled so it will not propagate further.

      Returns void

    • Returns the name of this object's type.

      Returns string

    • Marks the event as unhandled so it propagates to parent widgets.

      Returns void

    • Returns true if the object is of the specified type.

      Parameters

      • type: string

      Returns boolean

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

      Parameters

      Returns boolean