Options type defines the configuration object you can pass to customize the behavior of the useHotkeys hook.
Type Definition
Parameters
Main setting that determines if the hotkey is enabled or not. Can be a boolean or a function that returns a boolean based on the keyboard and hotkeys event.
Enable hotkeys on a list of form element tags. Can be a boolean to enable on all form tags, or an array of specific tags.
Enable hotkeys on elements with the
contentEditable attribute set to true.A function to conditionally ignore events. Return
true to ignore the event.Character used to split keys in hotkey combinations.
Character used to separate different hotkeys when defining multiple hotkeys in a single string.
Scope(s) in which the hotkey is active. Can be a single scope string or an array of scopes.
Trigger the callback on the
keyup event instead of keydown.Trigger the callback on the
keydown event. This is the default behavior.Prevent the default browser behavior for the hotkey. Can be a boolean or a function.
A description of what the hotkey does. Useful for generating help menus or documentation.
Listen to events on a specific document instead of the default window.
Ignore modifier keys (ctrl, alt, shift, meta) when matching hotkeys.
Pass through options to the underlying
addEventListener call.Listen to the produced key instead of the code. This is useful for non-US keyboards.
The timeout in milliseconds to wait for the next key to be pressed in a sequence.
The character used to split the sequence of keys.
Custom metadata to store and retrieve with the hotkey. Useful for storing additional context.
