Theia API Documentation v1.68.0
    Preparing search index...
    Index

    Constructors

    Properties

    commandRegistry: CommandRegistry
    contexts: { [id: string]: KeybindingContext } = {}
    corePreferences: CorePreferences
    keybindingsChanged: Emitter<void> = ...
    keybindingTree: undefined | TernarySearchTree<KeySequence, ScopedKeybinding[]>

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

    keyboardLayoutService: KeyboardLayoutService
    keymaps: ScopedKeybinding[][] = ...
    keySequence: KeySequence = []
    logger: ILogger
    statusBar: StatusBar
    toResetKeymap: Map<KeybindingScope, Disposable> = ...
    whenContextService: ContextKeyService
    PASSTHROUGH_PSEUDO_COMMAND: "passthrough" = 'passthrough'

    Accessors

    Methods

    • 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

      • asciiOnly: boolean = false

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

      Returns string

      a string representing the KeyCode

    • Parameters

      • input: string | KeyCode | KeyboardEventInit

      Returns KeyboardEventInit & Partial<{ keyCode: number }>

    • Clear all resolved properties of registered keybindings so the KeyboardLayoutService is called again to resolve them. This is necessary when the user's keyboard layout has changed.

      Returns void

    • 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.

      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

    • 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