1.6.1 • Published 1 year ago

keyb v1.6.1

Weekly downloads
11
License
MIT
Repository
github
Last release
1 year 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

1 year ago

1.6.0

1 year ago

1.5.0

1 year ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.1

5 years ago

1.2.0

7 years ago

1.1.0

9 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago