Description

Properties

A

Value of the A button

Z

Value of the Z button

E

Value of the E button

Q

Value of the Q button

Esc

Value of the Escape button

Enter

Value of the Enter button

Shift

Value of the Shift button

Ctrl

Value of the Ctrl button

Alt

Value of the Alt button

Space

Value of the Space button

Back

Value of the Back button

F1

Value of the F1 button

F2

Value of the F2 button

F11

Value of the F11 button

F12

Value of the F12 button

Left

Value of the left button

Up

Value of the Up button

Right

Value of the Right button

Bottom

Value of the Bottom button

Methods

press

Calling a function when a key is pressed (only once)

clearKeys

Clears the functions assigned to keys indicated

keyDown

Calling a function when a key is down

keyUp

Calling a function when a key is up

reset

Resets all keys. You must assign the buttons (press(), keyDown() and keyUp()) to restore movement and actions

lock

Lock the keys on the canvas and avoid scrolling of the page

isPressed

Whether a key is pressed

addKey

Add key (constant).

trigger

Simulates the call of a key

Discussion