pota/use/keyboard

pota/use/keyboard exports ref factories for keyboard chords: shortcut scopes to the element, globalShortcut listens on the document, and submitOnCtrlEnter is a convenience for textareas — plus useKeyHeld / keysHeld for tracking held keys.

Chords are a +-separated list of modifiers — ctrl, meta, alt, shift, plus the alias mod (ctrl on non-Mac, meta on Mac) — followed by a single key. Matching is strict: ctrl+s does not fire on ctrl+shift+s. The handler is called with the KeyboardEvent; preventDefault is applied automatically when the chord matches.

Exports