A quick search suggests keyboard event detection is a bitch.
However, this page offers some clues.
javascript code:
var keyDown = function(e) {
var evt = e || window.event;
switch (evt.keyCode) {
case 37: { // left arrow key
window.location = URL_FOR_NEXT_PAGE;
}
case 39: { // right arrow key
window.location = URL_FOR_PREV_PAGE;
}
}
return document.defaultAction; // might not be needed
// (I use jQuery which makes a lot of this stuff easier)
}; // keyDown()
// I dunno where you'd put this bit - <body onload="..."> maybe?
document.onkeydown = keyDown;
|