object containing data about the keyboard.
each of the object’s keys is a key returned by
KeyboardEvent.key. each value is an object with the following properties:
- press :
truewhen a keypress is detected.
press property of each key does not reset on its own. they should be manually set to
false at the end of your game loop; each keypress detected will then cause them to return
true for exactly one frame.
- held :
trueas long as the corresponding key is held down.