Keydownevent in fullscreen with FullScreen API

I use the JavaScript FullScreen API and jQuery in chrome and firefox. I want to stop keydownevent bubbling, because i don’t want that user left fullscreen mode with hotkeys (F11 and Ecs). But callback in chrome doesn’t call and callback in firefox call for F11 ,but not call for Esc. Why is this happening?

    'keydown': function (e) {
        alert('It works!');
        if (e.which == 122 || e.which == 27) {
             alert('F11 or Esc');
             return false;

var docElm = document.getElementById('gallery');
if (docElm.mozRequestFullScreen) {
else if (docElm.webkitRequestFullScreen) {

  • TypeError: asm.js type error: Disabled by debugger
  • ReferenceError: require is not defined
  • How can I provide a link inside my greasemonkey script to backup the GM_---value database?
  • clientHeight/clientWidth returning different values on different browsers
  • nicEditor link problems in Chrome and Firefox
  • ES2015 import doesn't work (even at top-level) in Firefox
  • HTML anchor tag download attribute not working in Firefox for jpg and png files
  • How to view or output a very long string from a console
  • Is `-moz-transform: scale(2)` equivalent to CSS `zoom: 2`?
  • Fixing “gBrowser.addProgressListener was called with a second argument, which is not supported” warning
  • Prototype swallows javascript errors (Firefox)
  • How to filter messages in Firefox Error Console?
  • One Solution collect form web for “Keydownevent in fullscreen with FullScreen API”

    It’s happening because it’s a built-in security method, which browser vendors have hard-coded expressly for the purpose of preventing the exact thing your client wants to do: keep people from leaving.

    Personally, I wish that esc was available for use as a button to bring up the menu of a fullscreen game (seeing as that’s what it’s done for years), but that’s not an option, currently.

    Of course, you could then listen for the exit-fullscreen, and after that bring up the game menu (which is weird), but otherwise, affiliate-marketers would just stuff you on full-page ads, make them full-screen, and provide no exit button, aside from closing the browser (which you couldn’t do without using the keyboard, which Fullscreen could ALSO prevent).