Skip to content

Allow multiple keyboard shortcuts per command #2867

Closed
@raineorshine

Description

@raineorshine

Current Behavior

Commands define aliases with hideFromHelp: true to allow additional keyboard shortcuts.

For example:

export const cursorDownAlias: Command = {
...cursorDownCommand,
id: 'cursorDownAlias',
gesture: undefined,
keyboard: { key: Key.ArrowDown, shift: true },
}

Expected Behavior

  • Expand Command.keyboard to allow Key[].
  • Show the first Key in the array in Command Palette, Help modal, etc.
  • The commandKeyIndex will need to be adapted to support multiple keyboard shortcuts but still allow O(1) lookup.
    • Consider adding one entry per keyboard shortcut (instead of one entry per command) so that hashKeyDown can still be used.
  • Remove command aliases that are no longer needed.

Metadata

Metadata

Assignees

Labels

refactorRefactor without changing behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions