Skip to content

@tmrw-realityos/worldDocs


@tmrw-realityos/world / Input

Class: Input

Input handing

Constructors

new Input()

new Input(): Input

Returns

Input

Properties

boundOnContext()?

optional boundOnContext: (e) => void

Parameters

e: Event

Returns

void

Defined in

input.ts:19


boundOnKey()?

optional boundOnKey: (e) => void

Parameters

e: KeyboardEvent

Returns

void

Defined in

input.ts:18


boundOnMouse()?

optional boundOnMouse: (e) => boolean

Parameters

e: PointerEvent

Returns

boolean

Defined in

input.ts:16


boundOnWheel()?

optional boundOnWheel: (e) => void

Parameters

e: WheelEvent

Returns

void

Defined in

input.ts:17


boundTarget?

optional boundTarget: HTMLElement

Defined in

input.ts:14


deltaPosition

deltaPosition: number[]

Defined in

input.ts:8


deltaWheel

deltaWheel: number = 0

Defined in

input.ts:11


mouseDownPosition

mouseDownPosition: number[]

Defined in

input.ts:9


mousePosition

mousePosition: number[]

Defined in

input.ts:7


mouseState

mouseState: number = 0

Defined in

input.ts:10


onKey()?

optional onKey: (e) => boolean

Parameters

e: KeyboardEvent

Returns

boolean

Defined in

input.ts:24


onMouse()?

optional onMouse: (e) => boolean

Parameters

e: PointerEvent

Returns

boolean

Defined in

input.ts:22


onWheel()?

optional onWheel: (e) => boolean

Parameters

e: WheelEvent

Returns

boolean

Defined in

input.ts:23

Methods

bindEvents()

bindEvents(target): void

Attaches input events to DOM. Keydown and keyup will be attached to document.body.

Parameters

target: HTMLElement

element to attach pointer events

Returns

void

Defined in

input.ts:31


isKeyPressed()

isKeyPressed(code): boolean

Parameters

code: string

Returns

boolean

Defined in

input.ts:126


processKey()

processKey(e): void

Parameters

e: KeyboardEvent

Returns

void

Defined in

input.ts:121


processMouse()

processMouse(e): boolean

Parameters

e: PointerEvent

Returns

boolean

Defined in

input.ts:97


processWheel()

processWheel(e): void

Parameters

e: WheelEvent

Returns

void

Defined in

input.ts:115


unbindEvents()

unbindEvents(): void

Removes event listeners from the target element

Returns

void

Defined in

input.ts:57


update()

update(): void

Returns

void

Defined in

input.ts:90