Skip to content

key: members

27 implemented, 0 reserved. Entries are sorted by name.

key.addListener(listener: object)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Adds an object that is sent onKeyDown and onKeyUp for every key event.

Key.addListener(this);

Specification: client-rendering.md§4.10.

key.backspace: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The key code of Backspace (8).

echo(Key.backspace);

Specification: client-rendering.md§4.10.

key.capsLock: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The key code of Caps Lock (20).

echo(Key.capsLock);

Specification: client-rendering.md§4.10.

key.control: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The key code of Control (17).

echo(Key.control);

Specification: client-rendering.md§4.10.

key.deleteKey: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The key code of Delete (46).

echo(Key.deleteKey);

Specification: client-rendering.md§4.10.

key.down: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The key code of the Down arrow (40).

echo(Key.down);

Specification: client-rendering.md§4.10.

key.end: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The key code of End (35).

echo(Key.end);

Specification: client-rendering.md§4.10.

key.enter: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The key code of Enter (13).

echo(Key.enter);

Specification: client-rendering.md§4.10.

key.escape: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The key code of Escape (27).

echo(Key.escape);

Specification: client-rendering.md§4.10.

key.getAscii() -> number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

The character code of the latest key event, 0 for a key with no character.

echo(Key.getAscii());

Specification: client-rendering.md§4.10.

key.getCode() -> number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

The key code of the latest key event.

echo(Key.getCode());

Specification: client-rendering.md§4.10.

key.home: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The key code of Home (36).

echo(Key.home);

Specification: client-rendering.md§4.10.

key.insert: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The key code of Insert (45).

echo(Key.insert);

Specification: client-rendering.md§4.10.

key.isAccessible(code: number) -> boolean

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

True when scripts can read the key with the given code.

echo(Key.isAccessible(Key.tab));

Specification: client-rendering.md§4.10.

key.isDown(code: number) -> boolean

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

True while the key with the given code is held.

if (Key.isDown(Key.shift)) echo("shift");

Specification: client-rendering.md§4.10.

key.isToggled(code: number) -> boolean

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

True while a lock key (caps, num or scroll lock) is switched on.

echo(Key.isToggled(Key.capslock));

Specification: client-rendering.md§4.10.

key.left: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The key code of the Left arrow (37).

echo(Key.left);

Specification: client-rendering.md§4.10.

key.onKeyDown()

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Raised on each listener when a key goes down; read the key with Key.getCode().

function onKeyDown() {
echo(Key.getCode());
}

Specification: client-rendering.md§4.10.

key.onKeyUp()

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Raised on each listener when a key is released; read the key with Key.getCode().

function onKeyUp() {
echo(Key.getCode());
}

Specification: client-rendering.md§4.10.

key.pgDn: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The key code of Page Down (34).

echo(Key.pgDn);

Specification: client-rendering.md§4.10.

key.pgUp: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The key code of Page Up (33).

echo(Key.pgUp);

Specification: client-rendering.md§4.10.

key.removeListener(listener: object) -> boolean

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Removes a listener; returns whether it was one.

Key.removeListener(this);

Specification: client-rendering.md§4.10.

key.right: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The key code of the Right arrow (39).

echo(Key.right);

Specification: client-rendering.md§4.10.

key.shift: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The key code of Shift (16).

echo(Key.shift);

Specification: client-rendering.md§4.10.

key.space: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The key code of the space bar (32).

echo(Key.space);

Specification: client-rendering.md§4.10.

key.tab: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The key code of Tab (9).

echo(Key.tab);

Specification: client-rendering.md§4.10.

key.up: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The key code of the Up arrow (38).

echo(Key.up);

Specification: client-rendering.md§4.10.

Engine version 0.1.0. Built 2026-11-18.