In Javascript, how do I tell if a user is pressing two keys at the same time?

前端 未结 4 2017
轻奢々
轻奢々 2021-02-09 13:30

In Javascript, how do I tell if a user is pressing two keys at the same time?

For example, I have drawn a circle in the middle of the screen. I want to move it up while

4条回答
  •  逝去的感伤
    2021-02-09 14:08

    Javascript keyboard events fire on keypress and keydown, but don't contain the additional keymask info to determine if other keys are pressed at the same time.

提交回复
热议问题