class InputEvent


Defines input events for SceneCore.

Summary

Nested types

Specifies the action (e.g. down, up, move, etc.) of the input event.

Information about the hit result of the input ray, originating from one of the InputEvent.Source, and intersecting with some Entity on the scene.

Specifies the pointer type (e.g. left, right or default) of the input event.

Specifies the source (e.g. hands, controller, head) of the input event.

Public constructors

InputEvent(
    source: Int,
    pointerType: Int,
    timestamp: Long,
    origin: Vector3,
    direction: Vector3,
    action: Int,
    hitInfoList: List<InputEvent.HitInfo>
)

Public functions

open operator Boolean
equals(other: Any?)
open Int

Public properties

Int

Actions similar to Android's MotionEvent for keeping track of a sequence of events on the same target, e.g., HOVER_ENTER -> HOVER_MOVE -> HOVER_EXIT, DOWN -> MOVE -> UP.

Vector3

A point indicating the direction the ray is pointing, in the receiver's activity space.

List<InputEvent.HitInfo>

List of HitInfo for the scene entities from the same task that were hit by the input ray, if any.

Vector3

The origin of the ray in the receiver's activity space.

Int

Type of the individual pointer (e.g. left, right or default) for this event.

Int

Type of source (e.g. hands, controller, head) that generated this event.

Long

Timestamp from SystemClock.uptimeMillis time base.

Public constructors

InputEvent

Added in 1.0.0-alpha05
InputEvent(
    source: Int,
    pointerType: Int,
    timestamp: Long,
    origin: Vector3,
    direction: Vector3,
    action: Int,
    hitInfoList: List<InputEvent.HitInfo> = emptyList()
)
Parameters
source: Int

Type of source (e.g. hands, controller, head) that generated this event.

pointerType: Int

Type of the individual pointer (e.g. left, right or default) for this event.

timestamp: Long

Timestamp from SystemClock.uptimeMillis time base.

origin: Vector3

The origin of the ray in the receiver's activity space.

direction: Vector3

A point indicating the direction the ray is pointing, in the receiver's activity space.

action: Int

Actions similar to Android's MotionEvent for keeping track of a sequence of events on the same target, e.g., HOVER_ENTER -> HOVER_MOVE -> HOVER_EXIT, DOWN -> MOVE -> UP.

hitInfoList: List<InputEvent.HitInfo> = emptyList()

List of HitInfo for the scene entities from the same task that were hit by the input ray, if any. The list is sorted from closest to farthest from the ray origin. Note that this first hit entity remains the same during an ongoing DOWN -> MOVE -> UP action, even if the pointer stops hitting the entity during the action.

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

Public properties

action

Added in 1.0.0-alpha05
val actionInt

Actions similar to Android's MotionEvent for keeping track of a sequence of events on the same target, e.g., HOVER_ENTER -> HOVER_MOVE -> HOVER_EXIT, DOWN -> MOVE -> UP.

direction

Added in 1.0.0-alpha05
val directionVector3

A point indicating the direction the ray is pointing, in the receiver's activity space.

hitInfoList

Added in 1.0.0-alpha05
val hitInfoListList<InputEvent.HitInfo>

List of HitInfo for the scene entities from the same task that were hit by the input ray, if any. The list is sorted from closest to farthest from the ray origin. Note that this first hit entity remains the same during an ongoing DOWN -> MOVE -> UP action, even if the pointer stops hitting the entity during the action.

origin

Added in 1.0.0-alpha05
val originVector3

The origin of the ray in the receiver's activity space.

pointerType

Added in 1.0.0-alpha05
val pointerTypeInt

Type of the individual pointer (e.g. left, right or default) for this event.

source

Added in 1.0.0-alpha05
val sourceInt

Type of source (e.g. hands, controller, head) that generated this event.

timestamp

Added in 1.0.0-alpha05
val timestampLong

Timestamp from SystemClock.uptimeMillis time base.