Sanekeys.js is a project mainly written in JavaScript, it's free.
javascript keyboard sanitizer
javascript keyboard sanitizer. to be used in html5 games, mostly.
it's not finished, optimized & tested. but it works.
API may change.
Basic usage:
sanekeys.setKeys({
'w': function(e) {
debug("going up");
},
's': function(e) {
debug("going down");
},
'a': function(e) {
debug("going left");
},
'd': function(e) {
debug("going right");
}
})
more info in the test.html file.
TODO:
holding a press b
. nesting?