Appearance
@tmrw-realityos/world • Docs
@tmrw-realityos/world / Input
Class: Input
Input handing
Constructors
new Input()
new Input():
Input
Returns
Properties
boundOnContext()?
optional
boundOnContext: (e
) =>void
Parameters
• e: Event
Returns
void
Defined in
boundOnKey()?
optional
boundOnKey: (e
) =>void
Parameters
• e: KeyboardEvent
Returns
void
Defined in
boundOnMouse()?
optional
boundOnMouse: (e
) =>boolean
Parameters
• e: PointerEvent
Returns
boolean
Defined in
boundOnWheel()?
optional
boundOnWheel: (e
) =>void
Parameters
• e: WheelEvent
Returns
void
Defined in
boundTarget?
optional
boundTarget:HTMLElement
Defined in
deltaPosition
deltaPosition:
number
[]
Defined in
deltaWheel
deltaWheel:
number
=0
Defined in
mouseDownPosition
mouseDownPosition:
number
[]
Defined in
mousePosition
mousePosition:
number
[]
Defined in
mouseState
mouseState:
number
=0
Defined in
onKey()?
optional
onKey: (e
) =>boolean
Parameters
• e: KeyboardEvent
Returns
boolean
Defined in
onMouse()?
optional
onMouse: (e
) =>boolean
Parameters
• e: PointerEvent
Returns
boolean
Defined in
onWheel()?
optional
onWheel: (e
) =>boolean
Parameters
• e: WheelEvent
Returns
boolean
Defined in
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
isKeyPressed()
isKeyPressed(
code
):boolean
Parameters
• code: string
Returns
boolean
Defined in
processKey()
processKey(
e
):void
Parameters
• e: KeyboardEvent
Returns
void
Defined in
processMouse()
processMouse(
e
):boolean
Parameters
• e: PointerEvent
Returns
boolean
Defined in
processWheel()
processWheel(
e
):void
Parameters
• e: WheelEvent
Returns
void
Defined in
unbindEvents()
unbindEvents():
void
Removes event listeners from the target element
Returns
void
Defined in
update()
update():
void
Returns
void