Canvas Toolkit
← Class index

CShortcut

Core · extends CObject

A single key combination active in its parent widget and descendants.

import { CShortcut } from "canvas-toolkit-lib";

Declared members

static normalizeSequence(key: string): string;

Validates and canonicalizes the single-combination shortcut syntax.

readonly activated: CSignal<[]>;
readonly activatedAmbiguously: CSignal<[]>;

Emitted instead of activated when the same owner has duplicate matches.

constructor(key: string, parent: CWidget);
key(): string;
setKey(key: string): void;
isEnabled(): boolean;
setEnabled(enabled?: boolean): void;
matches(event: CKeyEvent): boolean;

Used by CApplication when dispatching a key press.

static matchesSequence(sequence: string, event: CKeyEvent): boolean;

Matches a sequence without registering another keyboard binding.