Keys

Constructors

new

Keys

()

Creates a new instance of the keyboard event handler


Methods

getPressed

() ⇨ ReadonlyArray<number>

Returns an array of keyboard keys, if the value is one, then the key is pressed


Example:

gameloop(() => {
  const keys = game.key.getPressed()
  
  if (keys[Key.K_A])
    console.log('The key A is pressed!')
})