Javascript examples for DOM:Key Event
Check which key is pressed and which mouse button is click in onkeydown event
<html> <head> <meta name="viewport" content="width=device-width"> </head> <body> No developer toolbar //from w ww. java 2 s . c om <script> window.oncontextmenu = function () { return false; } document.onkeydown = function (e) { if (window.event.keyCode == 123 || e.button==2) return false; } </script> </body> </html>