Skip to content

KeysDefine

KeysDefine describes a keyboard shortcut for Spicetify.Keyboard.

type KeysDefine =
| string
| {
key: string;
ctrl?: boolean;
shift?: boolean;
alt?: boolean;
meta?: boolean;
};

A string must be a single key name from KEYS, such as "f8". A combined string such as "ctrl+shift+p" throws. Use the object form for a key with modifiers.

In the object form, key must also be a key name from KEYS. ctrl binds Mousetrap’s mod modifier, which is Cmd on macOS and Ctrl on Windows and Linux. meta binds the Cmd or Windows key.

const openSearch: Spicetify.Keyboard.KeysDefine = { key: 'k', ctrl: true };