keydown2 stops working after a period of use, and you have to quit Graal and restart it.
keydown is limited to a few keys.
This is a simple script that replicates
keydown2, without the glitches.
PHP Code:
/*
Replicates keydown2 without the glitches
*/
//#CLIENTSIDE
function onKeyPressed(code, key) {
this.keyPressed.(@ code) = true;
this.trigger("keyDown", code, key);
}
function GraalControl.onKeyUp(code, key) {
this.keyPressed.(@ code) = false;
this.trigger("keyUp", code, key);
}
function isCodeDown(keycode) {
return this.keyPressed.(@ keycode);
}
function isKeyDown(letter) {
return this.keyPressed.(@ getkeycode(letter));
}
I recommend putting it in a class, but you can also put the functions directly into the weapon.