Sequences are hot keys that are triggered by pressing keys sequentially. For example, ctrl then s is a sequence. You can register sequence hot keys with both global and scoped hot keys.
It is very straightforward to register sequence hot keys with global hot keys.
Keys of the sequence hot key is separated by _ in the string.
import { useGlobalHotKeys } from "@ez-kits/hot-keys-react";
function MyComponent() {
useGlobalHotKeys({
hotKeys: {
ctrl_k: () => {
console.log("ctrl_k is pressed");
},
},
});
}
Just same as registering global hot keys, you can register sequence hot keys with scoped hot keys.
import { useHotKeys } from "@ez-kits/hot-keys-react";
function MyComponent() {
useHotKeys({
scopeName: "test",
hotKeys: {
ctrl_k: () => {
console.log("ctrl_k is pressed");
},
},
});
}