Skip to content

christophe77/react-hid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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