?
Solved

Disable AltF4 key stroke

Posted on 2004-04-28
1
Medium Priority
?
645 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 36

Accepted Solution

by:
Zyloch earned 500 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

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 …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…
Suggested Courses

801 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