ComponentsActions
Hotkey
MudHotkey listens for a key combination anywhere on the page while it is rendered, then raises an event or reveals its content. Use it for shortcuts to actions that also exist as visible controls; never make a hotkey the only way to do something.
Shortcuts for visible actions
Each button has a hotkey that does the same thing. One handler serves several hotkeys by reading the Key from HotkeyEventArgs.
No commands yet. Press a button or its shortcut.
Revealing content
ChildContent stays hidden until the combination is pressed. HideChildContentOnRepress turns the same keys into a toggle.
Press Alt + Shift + H to show the observatory shortcuts, and again to hide them.
Playground
Pick a key and modifiers, then press them anywhere on the page. Modifiers must match exactly: Alt + Shift + K does not fire a hotkey registered for Alt + K.
0
Times AltLeft + KeyK was pressed
<MudHotkey
Key="JsKey.KeyK"
KeyModifiers="@([JsKeyModifier.AltLeft])"
OnHotkeyPressed="OnShortcut" />