Namespace: Key

Key

Static class that handles key events
Source:

Members

(static) A

Keycode for a
Source:

(static) ANY

Signifies to bind an event to a key event no matter what key is pressed
Source:

(static) D

Keycode for d
Source:

(static) DOWN

Keycode for down arrow key
Source:

(static) KEY_DOWN

Code for binding event to key down
Source:

(static) KEY_HELD

Code for binding event to key held
Source:

(static) KEY_UP

Code for binding event to key up
Source:

(static) LEFT

Keycode for left arrow key
Source:

(static) RIGHT

Keycode for right arrow key
Source:

(static) S

Keycode for s
Source:

(static) SPACE

Keycode for the spacebar
Source:

(static) UP

Keycode for up arrow key
Source:

(static) W

Keycode for w
Source:

Methods

(static) bind(key, keyDir, func)

Binds a function to a key
Parameters:
Name Type Description
key Number the key to bind to
keyDir Number Key.KEY_UP, Key.KEY_DOWN, or Key.KEY_HELD
func function the function to bind
Source:

(static) isDown(keyCode)

Checks if a key is currently pressed
Parameters:
Name Type Description
keyCode Number the key to check
Source:
Returns:
true if key is pressed

(static) reset()

Resets what keys are currently pressed
Source:

(static) update()

The update function, called from the game update
Source: