Can javascript tell the difference between left and right shift key?

前端 未结 4 1675
不知归路
不知归路 2020-11-30 09:41

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?

4条回答
  •  爱一瞬间的悲伤
    2020-11-30 10:14

    Internet explorer is capable of distinguishing left and right shift with the shiftLeft property:

    shiftLeft property (event)

    Otherwise, they are indistinguishable.

提交回复
热议问题