Javascript examples for DOM Event:ctrlKey
Use keydown event without affecting all keys
<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 o m function KeyPress(e) { var evtobj = window.event? event : e if (evtobj.keyCode == 90 && evtobj.ctrlKey) console.log("Ctrl+z"); } document.onkeydown = KeyPress; } </script> </head> <body> </body> </html>