Darksbane
08-14-2002, 02:01 PM
here is my code:
if(event && event.keyCode == 116){
// Capture and remap F5
keyString = String.fromCharCode(event.keyCode).toLowerCase();
alert(keyString);
alert (event.keyCode)
window.event.keyCode = 505;
}
if(event && event.keyCode == 505){
// New action for F5
alert('F5 key was pressed');
return false;
// Must return false or the browser will refresh anyway
}
My problem is that this also disables the 't' key. I am using IE 5.0 and when I view the keycode and the string entered when these two keys are pressed they are the same (they both return a keycode of 116 and a string 't'). I am doing this to try to disallow the refreshing of specific page (as when it is refreshed it screws up other parts of my code)
Any help would be appreciated.
Darksbane
if(event && event.keyCode == 116){
// Capture and remap F5
keyString = String.fromCharCode(event.keyCode).toLowerCase();
alert(keyString);
alert (event.keyCode)
window.event.keyCode = 505;
}
if(event && event.keyCode == 505){
// New action for F5
alert('F5 key was pressed');
return false;
// Must return false or the browser will refresh anyway
}
My problem is that this also disables the 't' key. I am using IE 5.0 and when I view the keycode and the string entered when these two keys are pressed they are the same (they both return a keycode of 116 and a string 't'). I am doing this to try to disallow the refreshing of specific page (as when it is refreshed it screws up other parts of my code)
Any help would be appreciated.
Darksbane