react-keymaster
A react component that listens to KeyDown And KeyUp event. Uses a fork of keymaster for keydown detection of special characters.
Example
Install
yarn add react-keymaster
Code
;;Component state = output: "Hello, I am a component that listens to keydown and keyup of a" ; { return <div> <h1>react-keymaster demo</h1> <ReactKeymaster keyName="a" onKeyDown= { this; } onKeyUp= { this; } /> <div>thisstateoutput</div> </div> ; }