ChemPal Documentation - v0.0.13-beta.5
    Preparing search index...

    Module hotkeys

    Functions

    HotkeyHelpModal

    Modal that lists every hotkey defined in config.json, grouped by the group field. Each row shows the formatted key combo (platform-aware) and the human-readable description.

    isMac

    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.

    resolveBinding

    Resolves a platform-aware KeyBinding down to a single string for the current platform. Pass-through when already a string.

    parseBinding

    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.

    matches

    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.

    formatBinding

    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.

    useHotkeys

    Installs a single global keydown listener on document that dispatches to the supplied handler map based on the application's hotkey config.

    getHotkeyConfigs

    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.

    Interfaces

    HotkeyConfig

    A single hotkey entry as loaded from config.json. id is the logical action name that is resolved at runtime against a handler registry.

    ParsedBinding

    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).

    Modules

    <internal>

    Type Aliases

    KeyBinding

    A platform-aware key binding. Either a single string shared across platforms, or an object with separate mac / other bindings.

    HotkeyHandlers

    Map of hotkey action id -> handler function. Used by useHotkeys. A handler may return a promise; errors are logged but not thrown.

    Variables

    FOCUS_GLOBAL_FILTER_EVENT

    Focus the "Filter results..." text input in the results table.

    TOGGLE_COLUMN_FILTERS_EVENT

    Toggle the per-column filter row in the results table.

    ABORT_SEARCH_EVENT

    Abort the currently-running search (same effect as the stop button).