react-hid
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

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);

Package Sidebar

Install

npm i react-hid

Weekly Downloads

1

Version

0.1.4

License

ISC

Unpacked Size

42.9 kB

Total Files

25

Last publish

Collaborators

  • christophe77