public static class ShortcutFormatHow a key combination is written down, for everything in the process that writes one.
Remarks
⚠ Neither half of this was ever view state, and living on a Control is what made it look like it was. KeyboardShortcut is a label that draws a chord, and it carried the process-wide formatter and the key-name table as statics — so a keymap wanting to say what Ctrl+Shift+S is called had to reference the controls library to ask a view class a question with no element in it. Vixen.Ui does not reference Vixen.Ui.Controls and must not, which is why a keymap could not live down here.
The formatter is process-wide on purpose. A shortcut is drawn by menus, by toolbar tooltips and by a command palette; an application that adapted the text at each call site would have to find all three and would still miss whichever one was added next. Replacing Formatter once changes every shortcut the process draws.
⚠ Describe is deliberately not platform-adapted. A Mac writes ⌘⇧S with no separators and a different modifier order, and getting that right needs to know what the program is running on — which this assembly, sitting below Vixen.Platform, does not. Knowing is the application's, and so is saying so.
Fields and properties (1)
public static Func<InputKey, ModifierKeys, string> FormatterHow every shortcut in the process is written.
Methods (2)
public static string Describe(InputKey key, ModifierKeys modifiers)Writes a combination the way a menu would.
public static string Name(InputKey key)What a key is called on a menu, with no modifiers in front of it.
Used by (3)
- KeyChordVixen.Ui
- KeyboardShortcutVixen.Ui.Controls
- ShortcutFormatTestsVixen.Ui.Tests