Preparing search index...

    Keyboard shortcut bound to a widget that emits a signal when its key sequence is activated.

        const root = new Widget(parent);
    const layout = new BoxLayout();
    layout.setDirection(Direction.TopToBottom);
    root.layout = layout;

    const status = new Label(root);
    status.text = 'Press Ctrl+Shift+R';
    layout.addWidgetWithStretch(status, 0, 0);

    const shortcut = new Shortcut(root, 'Ctrl+Shift+R', ShortcutContext.WidgetShortcut);
    this.connections.push(
    shortcut.onActivated.connect(() => {
    status.text = 'Ctrl+Shift+R activated';
    }),
    );

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    onActivated: signal0<void>

    Emitted when the shortcut's key sequence is pressed.

    onActivatedAmbiguously: signal0<void>

    Emitted when the key sequence matches multiple shortcuts and the target is ambiguous.

    Methods

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

      Parameters

      • type: string

      Returns boolean