-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Open
Description
Is your feature request related to a problem? Please describe.
Not a problem, just that author of KeyboardJS says to leverage Keystrokes in place of KeyboardJS for new projects:
I've create a new libary called Keystrokes which serves the same purpose as KeyboardJS, but is more refined, and takes full advantage of modern browsers. If you are considering using KeyboardJS in a new project, I recommend checking out Keystrokes first.
Describe the solution you'd like
A hook similar to useKeyboardJs which uses Keystrokes:
import useKeystrokes from 'react-use/lib/useKeystrokes';
const Demo = () => {
const [isPressed] = useKeyboardJs('a + b');
return (
<div>
[a + b] pressed: {isPressed ? 'Yes' : 'No'}
</div>
);
};
useKeyboardJs
could remain for now, but might be worth starting path to deprecation, but that is up to the author
Describe alternatives you've considered
Pretty straightforward support
Metadata
Metadata
Assignees
Labels
No labels