@enzohb/keyboard

1.0.0 • Public • Published

Keyboard JS

A wrapper around the odd DOM Event Listeners syntax

I wrote this simple wrapper that provides some useful funcionality for dealing with keyboard input in the browser with a more familiar and chained syntax using JavaScript. The code is written in ES6 and is also well self-commented. Feel free to make any improvements.

Basic usage

It's pretty straight forward.

import keyboard from 'keyboard.js';

const { on, ctrl } = keyboard;
const save = ctrl('s');

on(save).
down(saveState).
down(saveUserData).
up(notify);

One more thing

More usage examples are available in the Wiki Page. Also, if you found a bug, don't be shy and open an issue. I'll check as soon as possible.

Package Sidebar

Install

npm i @enzohb/keyboard

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

9.74 kB

Total Files

4

Last publish

Collaborators

  • enzohb