Class: Keyboard

Keyboard

new Keyboard(keymap)

Keyboard input handling. An instance of Keyboard is available as Splat.Game#keyboard.
Parameters:
Name Type Description
keymap module:KeyMap A map of keycodes to descriptive key names.
Source:

Methods

consumePressed(name) → {boolean}

Test if a key is currently pressed, also making it look like the key was unpressed. This makes is so multiple successive calls will not return true unless the key was repressed.
Parameters:
Name Type Description
name string The name of the key to test
Source:
Returns:
Type
boolean

isPressed(name) → {boolean}

Test if a key is currently pressed.
Parameters:
Name Type Description
name string The name of the key to test
Source:
Returns:
Type
boolean