mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-17 18:21:28 +10:00
release: v4.1.0
This commit is contained in:
@ -20,8 +20,13 @@ export const KeyboardShortcut = ({
|
||||
const { value, setValue } = useBoolean(defaultValue);
|
||||
|
||||
useEffect(() => {
|
||||
const onKeyDown = (e: KeyboardEvent) => e.key === "Control" && setValue(true);
|
||||
const onKeyUp = (e: KeyboardEvent) => e.key === "Control" && setValue(false);
|
||||
const onKeyDown = (e: KeyboardEvent) => {
|
||||
e.key === "Control" && setValue(true);
|
||||
};
|
||||
|
||||
const onKeyUp = (e: KeyboardEvent) => {
|
||||
e.key === "Control" && setValue(false);
|
||||
};
|
||||
|
||||
document.addEventListener("keydown", onKeyDown);
|
||||
document.addEventListener("keyup", onKeyUp);
|
||||
|
||||
Reference in New Issue
Block a user