0.1.0 • Published 8 years ago

kybrd v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

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.