Greasemonkey Javascript Key Press Help -
That's why I'm currently trying to create a grayscopy script that will allow the user to press the left or right on their keyboard. who are on the go or the next bar on the last comic strip I currently have some code, but it does not give me any results.
function keycheck () {var keyID = event.keyCode; Warning (keyid); } Document.onKeyDown = KeyCheck ();
This code is for debugging only to see that it is actually being executed, but when I press a key, nothing on the page will be there. I am also testing in Firefox.
Then after googling for a good 30 minutes, I do not support onkeydown outside the GreaseMonkey box . I had to use a function called "addEventListener", my last code returns the key pressed on the key on the site:
function keycheck (e) {alert (e.keycode); } Window.addEventListener ('keydown', key checking, true);
Comments
Post a Comment