Solved

Disable AltF4 key stroke

Posted on 2004-04-28
1
642 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
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…

829 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