Javascript examples for DOM:Key Event
disable keyboard's ContextMenu function with javascript in webpage
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*w w w .j a v a 2 s . c om*/ var keypressed = false; window.addEventListener ("keydown",function (e) { if (e.keyCode === 93) keypressed = true; }); window.addEventListener ("contextmenu",function (e) { if (keypressed) { e.preventDefault(e); keypressed = false; } }) } </script> </head> <body> </body> </html>