nn2 nn2 - 5 months ago 17
jQuery Question

What is the jQuery key code for Left Shift

What's the key code for left shift? When I press left shift do something..

Thanks

Answer

With JavaScript you can only detect Shift. You can't differentiate left and right shift. Using jQuery:

$("body").keypress(function(event) {
  if (event.shiftKey) {
    //do something here
  }
});
Comments