Keyboard Class

Module: Input

Keyboard instance for input in sync with the running application, internally stores the key transitions provided by the browser.

Allow to detect every key press, release event in sync with the app frame update.

The keyboard object provided by scripts is automatically updated by the runtime handler.

Methods

dispose

()

Create keyboard events.

dispose

()

Dispose keyboard events.

keyJustPressed

() Boolean

Check is a key as just pressed.

Returns:

Boolean:

True is the key was just pressed

keyJustReleased

() Boolean

Check if a key was just released.

Returns:

Boolean:

True is the key was just pressed

keyPressed

() Boolean

Check if a key is pressed.

Returns:

Boolean:

True is the key is currently pressed

reset

()

Reset keyboard status to default.

Does not clean the action list.

update

()

Update key flags synchronously.

Properties

actions

Array

The actions array serves as a buffer for the key input actions.

Until the update method is called it stores all the key stroke actions.

On update the key strokes are updated and the keys array stores the correct values.

events

EventManager

Event manager used to handle the keyup, keydown and focus events.

On each event actions are added to the actions array.

keys

Array

Array with keyboard keys status.

Attributes

A

Number

A key

ALT

Number

ALT key

B

Number

B key

C

Number

C key

CAPS_LOCK

Number

CAPS_LOCK key

CTRL

Number

CTRL key

D

Number

D key

DEL

Number

DEL key

DOWN

Number

DOWN key

E

Number

E key

END

Number

END key

ENTER

Number

ENTER key

ESC

Number

ESC key

F

Number

F key

F1

Number

F1 key

F10

Number

F10 key

F11

Number

F11 key

F12

Number

F12 key

F2

Number

F2 key

F3

Number

F3 key

F4

Number

F4 key

F5

Number

F5 key

F6

Number

F6 key

F7

Number

F7 key

F8

Number

F8 key

F9

Number

F9 key

G

Number

G key

H

Number

H key

HOME

Number

HOME key

I

Number

I key

INSERT

Number

INSERT key

J

Number

J key

K

Number

K key

L

Number

L key

LEFT

Number

LEFT key

M

Number

M key

N

Number

N key

NUM0

Number

NUM0 key

NUM1

Number

NUM1 key

NUM2

Number

NUM2 key

NUM3

Number

NUM3 key

NUM4

Number

NUM4 key

NUM5

Number

NUM5 key

NUM6

Number

NUM6 key

NUM7

Number

NUM7 key

NUM8

Number

NUM8 key

NUM9

Number

NUM9 key

O

Number

O key

P

Number

P key

PAGE_DOWN

Number

PAGE_DOWN key

PAGE_UP

Number

PAGE_UP key

Q

Number

Q key

R

Number

R key

RIGHT

Number

RIGHT key

S

Number

S key

SHIFT

Number

SHIFT key

SPACEBAR

Number

SPACEBAR key

T

Number

T key

TAB

Number

TAB key

U

Number

U key

UP

Number

UP key

V

Number

V key

W

Number

W key

X

Number

X key

Y

Number

Y key

Z

Number

Z key