D
Dave (DreamIsle)
I can't figure out why my keypress script is not working. I used the
following code:
document.onkeypress = KeyCheck;
function KeyCheck(e) {
var KeyID = (window.event) ? event.keyCode : e.keyCode;
//alert(KeyID);
switch(KeyID) {
case 13: title(); break;
case 37: move(-1); break;
case 38: toggle(1); break;
case 39: move(1); break;
case 40: toggle(1); break;
}
}
Here's my results:
-----------------------------------------------------------------------
Firefox: | Works fine.
IE: | Enter key works but arrow keys don't trigger the function.
Opera: | No keypresses work.
When I experienced problems, I tested the keypressing with the alert
you see in the comments of the code, but aside from working in FireFox
and the initial enter keypress in IE, nothing happened.
The whole page can be seen at http://thegriddle.net/rcr/ if you need to
see any of the other functions or the HTML or CSS. Any ideas or
suggestions would be great
following code:
document.onkeypress = KeyCheck;
function KeyCheck(e) {
var KeyID = (window.event) ? event.keyCode : e.keyCode;
//alert(KeyID);
switch(KeyID) {
case 13: title(); break;
case 37: move(-1); break;
case 38: toggle(1); break;
case 39: move(1); break;
case 40: toggle(1); break;
}
}
Here's my results:
-----------------------------------------------------------------------
Firefox: | Works fine.
IE: | Enter key works but arrow keys don't trigger the function.
Opera: | No keypresses work.
When I experienced problems, I tested the keypressing with the alert
you see in the comments of the code, but aside from working in FireFox
and the initial enter keypress in IE, nothing happened.
The whole page can be seen at http://thegriddle.net/rcr/ if you need to
see any of the other functions or the HTML or CSS. Any ideas or
suggestions would be great