View Full Version : Problem disabling the browser-help on F1 key press

11-08-2006, 01:45 PM
In the following code in Internet Explorer I am trying to disable the browser-specific help and launch a pop-up window on F1 key press. The pop-up window alone launches when I press F1. If the pop-up window is now minimised and I press on F1 again, the pop-up window comes to focus. But if the pop-up window is on focus and I press F1 again, the browser-specific help is launched. How do I prevent this?

<script language = "javascript">
function dispHelp(){

var keyCode = event.keyCode;
if(keyCode == 112){

winId = window.open( "http://www.yahoo.com", 'appHelp', features );
return false;


function disableDefault(){
event.returnValue = false;
return false;


<body onkeydown="dispHelp();" onhelp="disableDefault();">

Mr J
11-08-2006, 03:54 PM
But, what if your visitor wanted to use the browser help?

11-08-2006, 05:18 PM
You can capture any key, with some crossbrowser effort (and do something meanwile), but, for some of them, or combination of, you can not stop afterwards their default action. F1 is one of them, along, for instance (small list for Windows based OS) F5, ALT-F4, ESC, CTRL-ALT-DEL .... and so on... these are Operating System controled, thus there is nothing you can do to stop them.

Anyway... Why to change a well-known action of a wellknown key? This is nonsense, in my oppinion.

11-08-2006, 05:55 PM
It's not anything to do with the fact that you're not pulling the same F1 grab code into the popup is it?

If you're popping up a new window and not resetting the F1 funcionality then it'll act like a regular window's F1 key.

I dunno...