The action to perform when the keyboard shortcut is triggered, uses "click" if not defined.
ReadonlycontextReadonlyelementAllow an explicit target to be the element that the keyboard activates instead of the controlled element.
Keyboard shortcut string.
Scope of the keyboard shortcut, defaults to the normal MouseTrap (non-input) scope.
StaticblessingsStaticoutletsStatictargetsStaticvaluesStaticshouldIf custom keyboard shortcuts are disabled by user in settings then controller will not be loaded.
Handle the focus action on target element. If it is an input element containing text, also selects the existing text inside the field.
Handle the key event by preventing the default action and performing the specified action.
Set up the handleKey binding and check for an aria-keyshortcuts attribute to use as a fallback if the key value is not set.
When a key is set or changed, bind the handler to the keyboard shortcut. This will override the shortcut, if already set. Allow key to be empty, so it can be removed from the attributes to unbind the shortcuts
Staticafter
Adds the ability to trigger a button click event using a keyboard shortcut declared on the controlled element.
See
Example
Example: - use 'mod' for 'ctrl' on Windows and 'cmd' on MacOS
Example: - use 'global' scope to allow the shortcut to work even when an input is focused
Example
Example: - use a target element to trigger the click on a different element
Example: - trigger a focus instead of a click