Add a component for showing keyboard shortcuts.

Review Request #13600 — Created March 2, 2024 and submitted

Information

Ink
master

Reviewers

This introduces Ink.KeyboardShortcut, a utility component used to
display an available keyboard shortcut and optionally register it.

Keys are shown in a form that best matches the local operating system.
On macOS, the Control, Meta/Cmd, Alt/Option, and Shift keys show the
typical symbols, for instance. Some symbols are used in all cases, such
as arrows.

If a KeyboardShortcut is instantiated with an onInvoke and
registry options, then the keyboard shortcut will be registered in the
registry and the onInvoke handler will be called when the shortcut is
pressed. A special onInvoke value of click will trigger a click
event on this component, bubbling up to a parent, which will be useful
for buttons and menu items.

Unit tests pass.

Tested this with in-progress components, ensuring that registration
and event handling worked correctly.

Summary ID
Add a component for showing keyboard shortcuts.
This introduces `Ink.KeyboardShortcut`, a utility component used to display an available keyboard shortcut and optionally register it. Keys are shown in a form that best matches the local operating system. On macOS, the Control, Meta/Cmd, Alt/Option, and Shift keys show the typical symbols, for instance. Some symbols are used in all cases, such as arrows. If a `KeyboardShortcut` is instantiated with an `onInvoke` and `registry` options, then the keyboard shortcut will be registered in the registry and the `onInvoke` handler will be called when the shortcut is pressed. A special `onInvoke` value of `click` will trigger a `click` event on this component, bubbling up to a parent, which will be useful for buttons and menu items.
7206b02824a7314b777a82a1426b995c75cd776c

Description From Last Updated

Typos here: "parto"

maubinmaubin
david
  1. Ship It!
  2. 
      
maubin
  1. 
      
  2. Show all issues

    Typos here: "parto"

  3. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to master (f9c3497)