1.6.1 • Published 2 months ago

keyb v1.6.1

Weekly downloads
11
License
MIT
Repository
github
Last release
2 months ago

Keyb npm.io

A javascript utility for polling the state of the keyboard.

Usage

For any given frame of your game loop, you can poll if a key is being pressed using Keyb.isPressed(keyname):

if(Keyb.isPressed("W")) {
    player.position.y -= 1
}
if(Keyb.isPressed("S")) {
    player.position.y += 1
}
if(Keyb.isPressed("A")) {
    player.position.x -= 1
}
if(Keyb.isPressed("D")) {
    player.position.x += 1
}

All methods accept a keyname as defined in vkey, such as 1 or A or <enter>. Visit their test page to identify what keyname to use for each key on the keyboard.

License

This project is licensed under the MIT license.

1.6.1

2 months ago

1.6.0

2 months ago

1.5.0

2 months ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

6 years ago

1.1.0

8 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago