Solved

Disable AltF4 key stroke

Posted on 2004-04-28
1
638 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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now