Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 980 Bytes

index.mdx

File metadata and controls

44 lines (31 loc) · 980 Bytes
name route order
Docs
/
1

use-key-capture

use-key-capture is a custom hook which will let us not to worry about the key-press event. Just plugin in use-key-capture hook to the target we want to listen for key press event or by default it can listen for key-press event globally.

Installation

npm

npm i use-key-capture

yarn

yarn add use-key-capture

How it is used

import useKey from 'use-key-capture';
...
const { keyData, resetKeyData, getTargetProps } = useKey();

Properties

Property name Description
keyData gives pressed key details
resetKeyData resets the pressed key details

Target Prop getter

Property name Description
getTargetProps gives the required props to target element