InputEvent
class InputEvent
Defines input events for SceneCore.
Summary
Nested types |
|---|
class InputEvent.ActionSpecifies the action (e.g. down, up, move, etc.) of the input event. |
class InputEvent.HitInfoInformation about the hit result of the input ray, originating from one of the |
class InputEvent.PointerSpecifies the pointer type (e.g. left, right or default) of the input event. |
class InputEvent.SourceSpecifies the source (e.g. hands, controller, head) of the input event. |
Public constructors |
|---|
InputEvent( |
Public properties |
|
|---|---|
InputEvent.Action |
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 |
Vector3 |
The origin of the ray in the receiver's activity space. |
InputEvent.Pointer |
Type of the individual pointer (e.g. left, right or default) for this event. |
InputEvent.Source |
Type of source (e.g. hands, controller, head) that generated this event. |
Long |
Timestamp from SystemClock.uptimeMillis time base. |
Public constructors
InputEvent
InputEvent(
source: InputEvent.Source,
pointerType: InputEvent.Pointer,
timestamp: Long,
origin: Vector3,
direction: Vector3,
action: InputEvent.Action,
hitInfoList: List<InputEvent.HitInfo> = emptyList()
)
| Parameters | |
|---|---|
source: InputEvent.Source |
Type of source (e.g. hands, controller, head) that generated this event. |
pointerType: InputEvent.Pointer |
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: InputEvent.Action |
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 |
Public functions
Public properties
action
val action: InputEvent.Action
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
val direction: Vector3
A point indicating the direction the ray is pointing, in the receiver's activity space.
hitInfoList
val hitInfoList: List<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
val origin: Vector3
The origin of the ray in the receiver's activity space.
pointerType
val pointerType: InputEvent.Pointer
Type of the individual pointer (e.g. left, right or default) for this event.
source
val source: InputEvent.Source
Type of source (e.g. hands, controller, head) that generated this event.
timestamp
val timestamp: Long
Timestamp from SystemClock.uptimeMillis time base.