Javascript – How to disable Alt-Enter in IE

internet explorerjavascriptjavascript-events

As the default behavior of IE is to switch to the full screen mode on AltEnter command. I've to avoid this and have to attach a custom behavior.

Is it doable?

Best Answer

Not in JavaScript, no.

This is a behaviour of the application, which you don't really have control over (aside from browser extensions, and such).

You could try catching the key presses on your page, but it wouldn't prevent the user from easily circumventing it.

See http://www.webonweboff.com/tips/js/event_key_codes.aspx for a list of the character codes for keys. I'm pretty sure it's not reliable for catching combinations of key presses.

Besides, Alt+Enter in IE results in an expected behaviour and you should not try to override this via a webpage.