Skip to content

utility to figure out the "preferred" key chord to show for a given keyboard shortcut #9740

@maribethb

Description

@maribethb

Check for duplicates

  • I have searched for similar issues before opening a new one.

Problem

there are multiple scenarios where a keyboard shortcut has multiple possible keys that activate it, yet we only want to display one. for example, both delete and backspace keys activate the delete blocks shortcut, but we only want to display one of them (backspace on windows, delete on mac, and localized)

there is also some logic to make sure that key chords are always shown in the same order, e.g. ctrl+shift+del not del+shift+ctrl.

currently this complex logic lives in the keyboard experiment where it's used for context menus and the shortcut help menu.

Request

add a utility to blockly that "normalizes" the keyboard shortcuts and picks one key combination for shortcuts following the existing logic. probably in utils/. use the logic from the existing keyboard experiment.

Alternatives considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

issue: feature requestDescribes a new feature and why it should be added

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions