keys
description
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 :
boolean
changes totrue
when a keypress is detected.
the 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 :
boolean
returnstrue
as long as the corresponding key is held down.