Detects whether the current platform is macOS. Used to expand the mod
token and to select the mac branch of a platform-aware KeyBinding.
Falls back to navigator.platform for broad compatibility; the newer
userAgentData API is preferred when available.
Resolves a platform-aware KeyBinding down to a single string for the
current platform. Pass-through when already a string.
Parses a key-binding string such as "mod+shift+r" into a ParsedBinding.
The final +-separated token is treated as the key; earlier tokens are
modifiers. The mod token expands to meta on macOS and ctrl elsewhere.
Checks whether a KeyboardEvent matches a ParsedBinding. Matching is
strict on modifiers — any modifier that is not required in the binding
must not be held down, so ctrl+s will not also fire for ctrl+shift+s.
Key comparison is case-insensitive via event.key.
Normalizes a single binding token (e.g. "UpArrow", "Esc", "A") to the
lowercased KeyboardEvent.key value it should match. Unknown tokens map to
their own lowercased form.
Parses a sequential binding string such as "up+up+down+down+left+right"
into an ordered array of normalized keys. Unlike parseBinding, every
token is a key in the sequence — there are no modifiers.
Formats a sequential binding into per-step display labels for the help
modal — arrows become ↑ ↓ ← →, named keys are title-cased, and single
characters are upper-cased.
Formats a key-binding string into a human-readable label for display in the help modal. Uses platform-appropriate symbols (⌘ ⌥ ⌃ ⇧) on macOS and spelled-out names (Ctrl, Alt, Shift) elsewhere.
Returns the raw list of hotkey configs loaded from config.json. Useful
for the help modal or any UI that needs to enumerate the bindings.
A single hotkey entry as loaded from config.json. id is the logical
action name that is resolved at runtime against a handler registry.
Parsed representation of a key binding that can be matched against a
KeyboardEvent. Modifier flags are strict: a modifier set to false
must NOT be pressed (so ctrl+s does not also fire ctrl+shift+s).
A platform-aware key binding. Either a single string shared across platforms,
or an object with separate mac / other bindings.
Map of hotkey action id → handler function. Used by useHotkeys.
A handler may return a promise; errors are logged but not thrown.
Custom DOM event names used to bridge global hotkey handlers in
App.tsxto components that own the relevant local state (e.g.ResultsTable).