Class: Keyboard

hcje/device.Keyboard()

Keyboard handler.

Constructor

new Keyboard()

Construct the keyboard handler.

Source:

Methods

addDownListener(key, listener)

Add keydown listener.

Parameters:
Name Type Description
key string

String representation of key. See the KeyboardEvent.key values.

listener module:hcje/device~KeyEventListener

Listener for the key press.

Source:

removeDownListener(key)

Remove keydown listener previously added via a call to addDownListener.

Parameters:
Name Type Description
key string

String representation of key.

Source:

(static) simulateKeydown(key, dispatcheropt)

Dispatch a virtual key down event.

Parameters:
Name Type Attributes Default Description
key string

String representation of key. See the KeyboardEvent.key values.

dispatcher EventTarget <optional>
window

Event target used to dispatch the event.

Source: