Theia API Documentation v1.77.0
    Preparing search index...
    Index
    commandRegistry: CommandRegistry
    contexts: { [id: string]: KeybindingContext } = {}
    corePreferences: CorePreferences
    handledKeyboardEvents: WeakSet<KeyboardEvent> = ...
    keybindingsChanged: Emitter<void> = ...
    keybindingTree: TernarySearchTree<KeySequence, RuntimeKeybinding[]> | undefined

    Ternary search tree for efficient keybinding lookup. Maps resolved key sequences to arrays of bindings sorted by scope (highest first).

    keyboardLayoutService: KeyboardLayoutService
    keyboardShortcutsTroubleshooting: boolean = false

    Whether keyboard shortcut troubleshooting logs are enabled.

    keymaps: ScopedKeybinding[][] = ...
    keySequenceCandidates: KeySequence[] = ...
    logger: ILogger
    statusBar: StatusBar
    toResetKeymap: Map<KeybindingScope, Disposable> = ...
    warnedAmbiguousSequences: Set<string> = ...
    whenContextService: ContextKeyService
    PASSTHROUGH_PSEUDO_COMMAND: "passthrough" = 'passthrough'
    • Get the accelerator of the first keybinding of a command that is enabled in the given context. If no such keybinding exists and the command is enabled, the first enabled keybinding that is only displayed for the command is used, see common.Keybinding#displayFor. Physical accelerators (for native menus) are omitted for inactive keybindings.

      Parameters

      • commandId: string
      • context: HTMLElement | undefined
      • form: AcceleratorForm = 'logical'

      Returns string[]

    • Parameters

      • key: Key
      • asciiOnly: boolean = false

        if true, no special characters will be substituted into the string returned. Ensures correct keyboard shortcuts in Electron menus.

        Return a user visible representation of a single key.

      Returns string

    • Get a user visible representation of a key code (a key with modifiers).

      Parameters

      • keyCode: KeyCode

        the keycode

      • separator: string = ' '

        the separator used to separate keys (key and modifiers) in the returning string. Ignored when rendering macOS symbols (i.e. on macOS with asciiOnly=false), as the convention is to juxtapose modifier symbols without a separator (e.g. ⌃⌘V).

      • asciiOnly: boolean = false

        if true, no special characters will be substituted into the string returned. Ensures correct keyboard shortcuts in Electron menus.

      • form: AcceleratorForm = 'logical'

        whether to render the logical character or its physical realization

      Returns string

      a string representing the KeyCode

    • Parameters

      • input: string | KeyCode | KeyboardEventInit

      Returns KeyboardEventInit & Partial<{ keyCode: number }>

    • Executes the command by dispatching its first keybinding: the resolved key codes are matched directly, and a DOM keydown marked as already handled is dispatched to the target for other listeners to observe.

      Parameters

      • id: string
      • Optionaltarget: EventTarget

      Returns void

    • Dispatch a DOM keydown, optionally marking it as already handled by direct normalized dispatch.

      Parameters

      • input: string | KeyCode | KeyboardEventInit
      • target: EventTarget = ...
      • alreadyHandled: boolean = false

      Returns void

    • Whether the logical label of a key code shows Shift: when Shift is a command modifier or produces an uppercase letter. Shift that only selects a layout layer for other characters (e.g. / on German layouts) is not shown.

      Parameters

      Returns boolean

    • Return true of string a pseudo-command id, in other words a command id that has a special meaning and that we won't find in the command registry.

      Parameters

      • commandId: string

        commandId to test

      Returns boolean

    • Match first binding in the current context. Keybindings ordered by a scope and by a registration order within the scope.

      Uses a ternary search tree for efficient O(log n) lookup instead of O(n) iteration. The tree is lazily built and invalidated when keybindings change.

      keySequence must be a resolved sequence from resolveKeybinding or a runtime interpretation from getKeyCodeInterpretations. Lookup uses KeyCode.dispatchString identity, so raw KeySequence.parse output only matches when parsing and resolution coincide, such as keyboard.dispatch: 'keyCode'.

      When multiple bindings match, bindings that use context keys local to the focused element are given priority over bindings that only use global context keys.

      Parameters

      Returns KeybindingRegistry.Match | undefined

    • Run the command matching to the given keyboard event.

      Parameters

      • event: KeyboardEvent
      • inComposition: boolean = false

      Returns void

    • Selects the most appropriate binding from a list of enabled bindings. Prioritizes bindings whose when clause uses context keys that are locally defined at the focused element, as these are more specific to the user's current focus context.

      Parameters

      • enabledBindings: ScopedKeybinding[]

        Array of enabled bindings to choose from (must not be empty)

      • Optionalevent: KeyboardEvent

        Optional keyboard event to get the focused element from

      Returns ScopedKeybinding

      The selected binding

    • Mirrors VS Code's workbench.action.toggleKeybindingsLog command. It logs how each key press was interpreted so keyboard-layout problems can be diagnosed on other machines.

      Returns boolean