This commit is contained in:
Qing
2023-12-13 22:56:09 +08:00
parent 354a1280a4
commit 142aa64cc6
19 changed files with 360 additions and 181 deletions

View File

@@ -0,0 +1,11 @@
import { useStore } from "@/lib/states"
import { useHotkeys } from "react-hotkeys-hook"
const useHotKey = (keys: string, callback: any, deps?: any[]) => {
const disableShortCuts = useStore((state) => state.disableShortCuts)
const ref = useHotkeys(keys, callback, { enabled: !disableShortCuts }, deps)
return ref
}
export default useHotKey