0.1.0-beta.11 • Published 3 years ago
kbgb v0.1.0-beta.11
KBGB
Seth Meyers\: Stefon, do you have any recommendations for us for this weekend?
Stefon: Yes yes yes yes yes...this weekend, New York's hottest club is KBGB. It's like CBGB, but for JavaScript nerds instead of punk rockers. It's a keyboard utility for people who haven't done enough googling to find a better one.
Usage
This library is mainly meant for games, so we assume there is a render function of some kind called in a loop.
const kbgb = new KBGB({
keys: ['ArrowLeft'] // the keys to track
})
function render(args) {
// first call flush to update the keyboard state since the last iteration
kbgb.flush()
// now, the current state of the keyboard can be queried
if (kbgb.isDown('ArrowLeft')) {
// do something
}
// ...
}
0.1.0-beta.11
3 years ago
0.1.0-beta.10
3 years ago
0.1.0-beta.3
3 years ago
0.1.0-beta.5
3 years ago
0.1.0-beta.4
3 years ago
0.1.0-beta.7
3 years ago
0.1.0-beta.6
3 years ago
0.1.0-beta.9
3 years ago
0.1.0-beta.8
3 years ago
0.1.0-beta.2
4 years ago
0.1.0-beta.1
4 years ago