Creates a new HelpService instance.
The application context for determining current scope
The display service for toggling help UI
Optionalsettings: SettingsServiceWhere the reader's changed shortcuts are read from
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.
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.
The shortcuts as the dialog's unsaved edits have them
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.
The command to rebind
The new shortcut, as hotkeys-js would bind it
The shortcuts as the dialog's unsaved edits have them
Whether anything changed, what to say, and the overrides now
Puts a command's default shortcut back.
The command to restore
The shortcuts as the dialog's unsaved edits have them
Whether anything changed, what to say, and the overrides now
Puts every default shortcut back.
The shortcuts as the dialog's unsaved edits have them
Whether anything changed, what to say, and the overrides now
Toggles the visibility of the help menu interface.
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.