Jump to content

How To Block Alt Key

Guest parvez

Recommended Posts

You should explain more. What are you trying to accomplish?If you want to block the browser's own menu items, it won't work. The system intercepts all keystrokes before passing them to the application. Then the application intercepts keystrokes before passing them to the document event manager.If you simply want to test for the alt-key, this will work:element.onkeydown = function (e) { e = e || window event; k = e.keyCode; if (e.altKey) { // DO SOMETHING }}[/code]If you return false from the function, you will intercept the key event. If you return true, the key event will pass to the next handler on the schedule.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...