Class: Keyboard

Keyboard()

Manages keyboard input, tracking which keys are down and which were just pressed.

Constructor

new Keyboard()

Source:

Classes

Keyboard

Methods

keyDown(keyCode) → {boolean}

Checks if a specific key is currently held down.
Parameters:
Name Type Description
keyCode number The key code to check.
Source:
Returns:
True if the key is down, false otherwise.
Type
boolean

keyHit(keyCode) → {boolean}

Checks if a specific key was newly pressed in the current frame. This state is cleared at the end of the frame.
Parameters:
Name Type Description
keyCode number The key code to check.
Source:
Returns:
True if the key was just hit, false otherwise.
Type
boolean