Check Ctrl / Shift / Alt keys on 'click' event

Posted by Misha Moroshko on Stack Overflow See other posts from Stack Overflow or by Misha Moroshko
Published on 2010-05-17T06:52:57Z Indexed on 2010/05/17 7:00 UTC
Read the original article Hit count: 237

Filed under:
|
|

How could I identify which Ctrl / Shift / Alt keys are pressed in the following code ?

$("#my_id").click(function() {
    if (<left control key is pressed>) { alert("Left Ctrl"); }
    if (<right shift and left alt keys are pressed>) { alert("Right Shift + Left Alt"); }
});

Thanks !

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript