npm

mobx-keyboard
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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

More docs

KeyboardEvent KeyboardEvent Code Nice utility by @wesbos

Readme

Keywords

none

Package Sidebar

Install

npm i mobx-keyboard

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

5.09 kB

Total Files

6

Last publish

Collaborators

  • rakannimer