MAIDR JavaScript API
    Preparing search index...

    Class HelpService

    Service for managing context-sensitive help menus across different application scopes.

    Also works out what changing a shortcut comes to (#189) -- the conflict that refuses it, the message to announce, the overrides after it -- for the settings dialog, which is where a reader changes one. The help menu itself only lists the keys. Nothing is saved here: the dialog saves the overrides with its other settings, which is what the keybinding service observes to take them up, and what survives a reload.

    Index

    Constructors

    Methods

    • Retrieves help menu items for the current application scope.

      Built on first use and kept until the language or the reader's shortcuts change, so a reader who switches language sees the shortcut list in the new one the next time they open help, and one who changes a shortcut sees the new key at once.

      Returns HelpMenuItem[]

      Array of help menu items or empty array if no items for current scope

    • Every shortcut the reader may change, once each, grouped and ordered as the help menu orders them.

      For the settings dialog, which is where a shortcut is changed. It is not tied to a scope the way the help menu is -- the dialog is open over the chart, not in it -- so it gathers the rows of every scope that can open help, the first scope to bind a command naming it.

      Parameters

      Returns HelpMenuItem[]

      The rebindable rows, with their effective keys

    • Gives a command the shortcut the reader just pressed.

      Refused, with the reason spoken, when the shortcut already runs another command anywhere this one is bound: two commands on one key would make whichever hotkeys-js ran first the winner, silently, and the reader would have lost a shortcut they did not mean to give up.

      Nothing is saved here. The settings dialog keeps the result with its other unsaved edits, so Cancel takes a changed shortcut back like any other setting.

      Parameters

      • commandKey: string

        The command to rebind

      • combo: string

        The new shortcut, as hotkeys-js would bind it

      • overrides: KeybindingOverrides

        The shortcuts as the dialog's unsaved edits have them

      Returns RebindResult

      Whether anything changed, what to say, and the overrides now

    • Toggles the visibility of the help menu interface.

      Returns void