Using e.keyCode || e.which; how to determine the difference between lowercase and uppercase?
just use e.which
in jquery. They normalize this value for all browsers.
Additionally you can check for e.shiftKey
.
Whether it's 'a' or 'A', 65 is the result of the key pressed on the keyboard and it's always 65 for that key.
The event will only specify which key is pressed and not its value; those are two separate things. You can test for event.shiftKey along with the key that you're looking for, but I don't believe that will handle the scenario where Caps Lock is enabled.