• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 647
  • Last Modified:

Disable AltF4 key stroke

Set up: Intranet kiosk, IE is shelled as the App running. We have a 3 screen password lookup that the students can not exit except using Alt+f4. This closes IE and means reboot required and No matter what signs we put up the 10% will do Alt+f4. Can I disable the Alt+f4 keystroke with Javascript?  OnbeforeUnload and onUnload scripts have been tried with out success ( but I am not a JScript person so fell free to suggest.  
0
jbogren
Asked:
jbogren
1 Solution
 
ZylochCommented:
Hmm... It is possible to detect Alt+F4 with JavaScript, but it isn't too easy to stop it. The only way I can think of is to do this and put this in a script tag in the HEAD

document.onkeydown = function(){
if (window.event.altKey && (window.event.keyCode == 115)) {
oldWin=window.open('self.location','oldWin','height=300,width=300,hi=8');
oldWin.focus();
return false;
}
}

This code somehow managed to work on my IE6... It's because there is an error in the code and it suppresses the AltF4. I'm not sure whether an error message pops up on your computer or not, but all the other methods detect it, but cannot stop it...

--Zyloch
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now