Key Press Events

Makes your Lens react to keys on a physical keyboard, alongside its other controls. Say what each key does, for example a key that makes your character jump.

Camera, Audio & Sensors

Camera feed, hand and face tracking, touch, tilt, haptics, and sound.

Made with this block

Events

onKeyPressed

Event fired when a key is pressed. Payload: `{ key: Keys, modifiers: KeyModifiers[] }`. Repeats while a key is held (OS key-repeat).

onKeyReleased

Event fired when a key is released. Payload: `{ key: Keys, modifiers: KeyModifiers[] }` (same shape as `onKeyPressed`).

Functions

isKeyPressedboolean

Returns `true` while `key` (a `Keys` value) is held down.

getPressedKeysObject

Returns the `Keys[]` currently held down.