Skip to content

rakannimer/mobx-keyboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Map keyboard keydown and keyup event to a pressedKeys observable map

Resources

Stars

Watchers

Forks

Packages

No packages published