Disable Hotkeys for Netscape 6 & 7?

admin

Administrator
Staff member
I'm trying to figure out how to disable certain hotkeys (ctrl + n, ctrl + o, etc...) and i'm having some trouble with netscape 6 and 7 browsers. Heres what i've got right now...


// called onLoad
function WinOpen () {

try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
} catch (err) {
document.write("Sorry, you can not enjoy this site because of " + err + ".");
return false;
}

window.open("nn_keycode.htm","newWindow","titlebar=no,hotkeys=no");
}

// code on newly opened window (disabled hotkey window)
function docKeyDown (event) {

if(event.ctrlKey && event.keyCode == 78) {
alert('ctrl + n hit');
event.cancelBubble = true;
return false;
}

}

document.addEventListener("keydown",docKeyDown,false);


In this script, i'm detected for <ctrl> + <n> and it successfully detects the hotkey combo (by displaying alertbox), but it also opens up a new browser window, which i don't want.

Any ideas, or prior experience?
 
Back
Top