Javascript onkeypress
问题 I have a question regarding the onkeypress event on Javascript. Is it possible to detect Just Ctl key or Alt Key? At the moment if both Ctl and m are pressed the onkeypress event can trigger a click. Is it possible to do just Ctl key by itself? Looking forward to your comments 回答1: onkeypress just catches character keys. Use onkeydown and/or onkeyup for the other keys. See Peter-Paul Koch on key events. 回答2: From the looks of it, no, you can't just capture the Ctrl key. The hotkeys jQuery