kybrd

0.1.0 • Public • Published

Kybrd - A tiny keyboard state library

Example

var keyboard = new Kybrd();
keyboard.isPressed('a'); // Returns true if 'a' is pressed
keyboard.isPressed('left'); // Use strings to describe non alpha-numeric keys

API Documentation

Kybrd

new Kybrd([element]);

Constructor.

Parameters:

  • element - The element to listen to keyboard events on.
Kybrd.prototype.isPressed(key);

Check whether a key is pressed.

Parameters:

  • key - The character or name of the key.

/kybrd/

    Package Sidebar

    Install

    npm i kybrd

    Weekly Downloads

    1

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • oampo