Can javascript tell the difference between left and right shift key?
Mostly this is a sanity check. The key code for both shift keys is 16. Does that mean it is actually impossible to distinguish a left and right shift events in a browser? In newer browsers supporting DOM3 you can use event.location to check the location. In the DOM3 spec , there are 4 constants defined for location, DOM_KEY_LOCATION_STANDARD , DOM_KEY_LOCATION_LEFT , DOM_KEY_LOCATION_RIGHT , and DOM_KEY_LOCATION_NUMPAD . In this case, you can do: if (event.location === KeyboardEvent.DOM_KEY_LOCATION_LEFT){ } else if (event.location === KeyboardEvent.DOM_KEY_LOCATION_RIGHT){ } MattG Internet