use-short-key
v0.0.3
Published
use-short-key
Downloads
2
Readme
use-short-key
use-short-key
helps register short keys for your application. It has almost same API as KeyboardEvent.
English | 中文
Get Started
- install
npm i use-short-key
- register a short key
const Component = () => {
// register on `⌘C`
useShortKey({
metaKey: true,
code: 'KeyC',
keydown: (e: KeyboardEvent) => {
// ...
},
});
// ...
};