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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...