PHP Code:
function GraalControl.onKeyDown(code, key, scan) {
// if you care about matching default controls, use if (keydown) here
if (key == "a" && ! this.keyA) {
player.chat = "tap!";
this.keyA = true;
}
}
function GraalControl.onKeyUp(code, key, scan) {
if (key == "a") {
this.keyA = false;
}
}
It's certainly possible to do via timeout, as Dusty instructed, but there's no reason to do so when it can be done using events.