ki Posted May 8, 2007 Share Posted May 8, 2007 How can I use key commands in JS? like Ctrl + M or something Quote Link to comment Share on other sites More sharing options...
nogray Posted May 8, 2007 Share Posted May 8, 2007 You can get which CTRL or shift button is clicked from the event object, something like this <body onkeypress="show_which_ctrl(event);"> <script language="javascript"> function show_which_ctrl(e){ if (e.ctrlKey) alert("CTRL key pressed"); } </script> Hold ctrl and click a button </body> If you use the CTRL key, the browser shortcuts will work first (for example, CTRL+A will select the entire document). more details here http://msdn2.microsoft.com/en-us/library/ms536939.aspx any left button is only set for IE. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.