For security reasons, no browser will allow any page to take away from the user the most basic controls - such as minimizing the window, switching to another one, etc. Nothing prevents, for example, the use of Alt+Tab or Ctrl+Alt+Del - and from there the user will probably be able to do what he wants. I do not know in depth the mode fullscreen, but I know that the user needs to give permission to enter full screen, and I’m sure that the browser does not allow you to overload the command to exit it, whatever it is.
I suggest you "take a step back" and assess exactly what problem are you trying to solve (and not only the imagined solution).
It is a registration program and the user cannot leave the full screen...
Register in what? Can’t leave the full screen why? Is it to resolve any technical issues on your website/service/app (and if so, which one?) or for security reasons? Are there alternatives? It is important that these details are well thought out - and the most appropriate solution employed (whether using native browser features, or using OS-specific plugins and/or features). For in the general case the only correct answer to your question is: "it is impossible to block the keyboard completely in jQuery".
Which browser exits full screen with ESC? I tried Chrome and Firefox and both ignore by default.
– Guilherme Bernal
All leave the fullscreen with ESC as far as I know, at least the internet explorer comes out...
– Alan PS
Have you tried it
$(document).keydown(function(e) { return false; });
?– Sergio
He keeps coming out of the fullscreen Sergio!
– Alan PS
Probably this is independent of the Browser, but a function of the OS. However, I find it advisable to prevent the user from leaving full-screen...
– Sergio
It is a registration program and the user cannot leave the full screen, I disabled F1 with Cód: Document.onhelp = Function() { Return(false); } window.onhelp = Function() { Return(false); } probably has some way to disable Esc
– Alan PS
Besides giving
return false;
, have triede.preventDefault();
?– carlosrafaelgn
Yes, and it didn’t work...
– Alan PS