The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Disable F11 keyboard shortcut in IE8

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #38203

    Hi There,

    I’m trying to disable F11 key press in my application.

    Previously i was using the below code to throw a JavaScript alert when user hits F11 key.

    	if (e.keyCode == 122 && e.type == "keydown")
    alert ("F11 is not currently supported by this application.")
    e.keyCode = false;
    e.cancelBubble = true;
    e.returnValue = false;
    return false;

    The above code works fine when i was using IE6.

    When i start using IE8, it did not work.
    I tried to use e.preventDefault() inside the above if loop, but it did not work as expected in IE8.

    Still the Browser goes into Full Screen Mode (which i don’t want to do)

    Please provide your valuable thoughts.



    F11 is the kind of standard functionality (just like right-clicking) that you should never take away from the user.


    @sneff – Thanks for the suggestions. But restricting the F11 key is the ask from the team. Previously we were able to suppress in IE6. But the same code doesn’t work.

    Anyone Please provide some solution on the same.


    Try using JavaScript to detect when the viewable browser size reaches the same size (within a few pixels) as the actual screen size. Then you could throw up your alert to tell the user to exit full screen mode.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.