Skip to main content

Interface: KeyboardInputOptions

Defined in: src/interaction/KeyboardInput.ts:51

Options for a KeyboardInput.

Properties​

autoEnable?​

optional autoEnable: boolean

Defined in: src/interaction/KeyboardInput.ts:62

Attach the listeners immediately on construction. Set false to attach later with KeyboardInput.enable. Default true.


preventDefault?​

optional preventDefault: boolean | string[]

Defined in: src/interaction/KeyboardInput.ts:57

Call preventDefault() on handled key events. true applies to every key; an array restricts it to the listed (normalized) keys. Use it so game keys such as the arrows and Space do not scroll the page. Default false.