mobx-keyboard
v1.1.0
Published
Map keyboard keydown and keyup event to a pressedKeys observable map
Downloads
5
Readme
Mobx Keyboard
Map keyboard keydown and keyup event to a pressedKeys observable map
Installation
yarn add mobx-keyboard
# or
npm i mobx-keyboard
Usage
const { pressedKeys, unsub } = getMobxKeyboard();
// Press a on keyboard
pressedKeys.get("KeyA"); // => {key, code, keyCode, ...}
unsub(); // Stop listening to events