react-hid
v0.1.5
Published
React hooks for capturing entries from HID devices.
Downloads
31
Maintainers
Readme
React HID
React hooks for capturing entries from HID devices.
Install
yarn add react-hid
or
npm install --save react-hid
Usage
Retrieve all key strokes before an action key is pressed
import { useHidWithActionKey } from 'react-hid';
const handleKeys = (keys: string) => {
console.log(keys);
};
useHidWithActionKey('Enter', handleKeys);
Retrieve all key strokes real time
import { useHid } from 'react-hid';
const handleKey = (key: string) => {
console.log(key);
};
useHid(handleKey);