What's the key code for left shift? When I press left shift do something..
Thanks
What's the key code for left shift? When I press left shift do something..
Thanks
As you can see from this page, the browser does not differentiate from left and right shift. I don't think it's possible.
With JavaScript you can only detect Shift. You can't differentiate left and right shift.
<body onKeyPress='if (event.shiftKey) alert("do something");'>
</body>
JQuery:
$("body").keypress(function(event) {
if (event.shiftKey) {
//do something here
}
});
The only way to know is to ask the user.
So what that means is it not possible with code alone, and not desirable to ask the user.
There is probably a better solution to the problem you think you have.