Solved

Disable AltF4 key stroke

Posted on 2004-04-28
1
641 Views
Last Modified: 2012-08-14
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
Comment
Question by:jbogren
1 Comment
 
LVL 36

Accepted Solution

by:
Zyloch earned 125 total points
ID: 10943473
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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question