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