Click to See Complete Forum and Search --> : Disable F11 key in IE


nandosabbath
03-21-2003, 07:26 AM
I need a script to disable the F11 key in the Internet Explorer browser

pyro
03-21-2003, 09:17 AM
You can't disable the browser hot keys...

vampyvampire
07-16-2007, 12:44 AM
Here is the Script to Block / disable F11 Key

<SCRIPT LANGUAGE="JavaScript">

function onKeyDown() {
if ( (event.altKey) || ((event.keyCode == 8) &&
(event.srcElement.type != "text" &&
event.srcElement.type != "textarea" &&
event.srcElement.type != "password")) ||
((event.ctrlKey) && ((event.keyCode == 82)) ) ||
(event.keyCode == 122) ) {
event.keyCode = 0;
event.returnValue = false;
}
}


</script>
<body onkeydown=onKeyDown()>

</SCRIPT>

Tweak4
07-16-2007, 12:38 PM
1. The code vampy posted is easily defeatable by a wide variety of surfers, and while it may stop some people from using the F11 function, it definitely will not stop all, or possibility even most of them.

2. The above code does not address the fact that someone could just as easily select View>Full Screen from their menu bar. The people that don't know how to disable the above script manually are also the ones who are less likely to know the F11 shortcut even exists, thus rendering the script even more useless.

3. Attempting to disable built-in browser functionality is a sure-fire way to piss off users and ensure that they leave your site as quickly as they can, and only return if there is no other option. It is a very bad habit to get into, and if your site requires such hack code to function, then you really need to go back and improve your over-all site design, rather than trying to take away legitimate user abilities granted to them by their browsers.

thechasboi
07-16-2007, 12:48 PM
Tweak4 has a few points all be harshly stated but points none the less. I do the same support of browser fixing on my site as well. Some times a browser does not do what you desire or need it to do so in order for the people on my site to use it they need to put up with the two limitations from the browsers problems. What I mean is that ff and flash in mac have a problem in a certain mode for the browser and the flash it self so if these two combinations happen in my editor the user is given something a little different than what they might expect but a note is given to explain why this is happening. Well enough with the goings on and Hope this helps.

Tweak4
07-16-2007, 02:43 PM
Yeah- sorry about that. I tend to get a little frustrated when the same sorts of topics come up again and again.
This one falls nicely into the "disabling browser functions that you have no right to disable and can't do reliably anyway" category, right next to those useless no-right-click scripts that people who don't know any better think protect their images and source from evil hackers.

felgall
07-16-2007, 02:45 PM
Most browsers these days give the browser owner the ability to disable access to those things that interfere with their browser functionality while still allowing JavaScript to run in the web page.

mrhoo
07-16-2007, 07:34 PM
How about making the f11 key in IE close IE and open firefox....