class PanelInputListener(ctx: SpatialContext, clickButtons: Int, scene_: Scene) : InputListener
PanelInputListener
(
ctx
, clickButtons
, scene_
)
|
Signature
constructor(ctx: SpatialContext, clickButtons: Int, scene_: Scene) Parameters clickButtons: IntÂ
Bit mask of buttons that can trigger click events
Returns PanelInputListener |
obtainMotionEvent
(
downTime
, eventTime
, action
, locX
, locY
, sourceOfInput
)
|
Signature
fun obtainMotionEvent(downTime: Long, eventTime: Long, action: Int, locX: Float, locY: Float, sourceOfInput: Int): MotionEvent Parameters downTime: LongeventTime: Longaction: IntlocX: FloatlocY: FloatsourceOfInput: IntReturns MotionEvent |
onClick
(
receiver
, hitInfo
, sourceOfInput
)
|
Called when a "click" is released while pointing at the object. This is a trigger release for controllers, and a pinch release for hands.
This method is invoked at the end of a click interaction, when the user releases a button that was pressed while pointing at the object. It's paired with InputListener.onClickDown, which is called when the button is initially pressed.
Signature
open fun onClick(receiver: SceneObject, hitInfo: HitInfo, sourceOfInput: Entity) Parameters |
onClickDown
(
receiver
, hitInfo
, sourceOfInput
)
|
Called when a "clickDown" is processed while pointing at the object. This is a trigger press for controllers, and a pinch for hands.
This method is invoked at the start of a click interaction, when the user presses a button while the pointer is over the object. It's paired with InputListener.onClick, which is called when the "click" is released.
Signature
open fun onClickDown(receiver: SceneObject, hitInfo: HitInfo, sourceOfInput: Entity) Parameters |
onHoverStart
(
receiver
, sourceOfInput
)
|
Called when the pointer starts hovering over the object.
This method is invoked when a controller ray first enters the object's bounds. It's paired with InputListener.onHoverStop, which is called when the pointer leaves the object.
Signature
open fun onHoverStart(receiver: SceneObject, sourceOfInput: Entity) Parameters |
onHoverStop
(
receiver
, sourceOfInput
)
|
Called when the pointer stops hovering over the object.
This method is invoked when a controller ray exits the object's bounds after previously hovering over it. It's paired with InputListener.onHoverStart, which is called when the pointer first enters the object.
Signature
open fun onHoverStop(receiver: SceneObject, sourceOfInput: Entity) Parameters |
onInput
(
receiver
, hitInfo
, sourceOfInput
, changedIn
, buttonState
, downTime
)
|
Called when any input event occurs on the object. It provides raw button state information through bit masks that can be interpreted using ButtonBits constants.
Hovering itself is considered an input event, but pressing and holding a button down will send input to the last focused object.
Signature
open override fun onInput(receiver: SceneObject, hitInfo: HitInfo, sourceOfInput: Entity, changedIn: Int, buttonState: Int, downTime: Long): Boolean Parameters changedIn: IntÂ
A bit mask indicating which buttons have changed state
buttonState: IntÂ
A bit mask indicating the current state of all buttons
downTime: LongÂ
The timestamp when the input interaction began (initial button change)
Returns BooleanÂ
True if the input was handled, false otherwise
|
onPointerEvent
(
receiver
, hitInfo
, type
, sourceOfInput
, scrollInfo
, semanticType
)
|
Called for pointer events on the SceneObject.
Signature
open fun onPointerEvent(receiver: SceneObject, hitInfo: HitInfo, type: Int, sourceOfInput: Entity, scrollInfo: Vector2, semanticType: Int) Parameters |
stopInput
(
receiver
, sourceOfInput
, downTime
)
|
Called when input interaction with a SceneObject stops. This will be called once the controller stops hovering, or if a button is held down, when the button is released.
Signature
open override fun stopInput(receiver: SceneObject, sourceOfInput: Entity, downTime: Long) Parameters downTime: LongÂ
The timestamp when the input interaction began (last button change)
|