Constructor
Creates a new HotKeyPad instance.Configuration options for the HotKeyPad instance. See Configuration for all available options.
Example
Methods
setCommands()
Sets the commands to display in the command palette.Array of command objects. Each command must have an
id, title, hotkey, and handler. See Types for the complete interface.Example
open()
Opens the command palette interface.- Makes the palette visible
- Dispatches a
hotkeypad:opencustom event - Focuses the search input
Example
close()
Closes the command palette interface.- Hides the palette
- Dispatches a
hotkeypad:closecustom event - Clears the search input
- Removes event listeners
Example
Properties
activationKey
Returns the activation key based on the user’s operating system.Returns
"Cmd" on macOS or "Ctrl" on other platforms. This is automatically detected based on the user agent.Example
instance
Reference to the root HTML element with idhotkeypad.
The DOM element that serves as the container for the entire HotKeyPad interface.