Skip to main content
Version: 12 Dec 2024

TouchpadGestureEvent

The event data related to a Magic Leap Touchpad gesture More...

Inherits from:
IEquatable< TouchpadGestureEvent >

Detailed Description

public struct TouchpadGestureEvent : IEquatable< TouchpadGestureEvent > 

See: XRGestureSubsystem


Public Fields

angle

Angle from the center of the touchpad to the finger.


public float angle { get; set; }


controllerId

The controller id associated with this gesture.


public byte controllerId { get; set; }


direction

Direction of gesture


public InputSubsystem.Extensions.TouchpadGesture.Direction direction { get; set; }

TypeDescription
InputSubsystem.Extensions.TouchpadGesture.DirectionDirection of touchpad gesture. Links to MLInputControllerTouchpadGestureDirection in ml_input.h.

distance

For radial gestures, this is the absolute value of the angle. For scroll and pinch gestures, this is the absolute distance traveled in touchpad distance. The touchpad is defined as having extents of [-1.0,1.0] so this distance has a range of [0.0,2.0].


public float distance { get; set; }


id

The GestureId associated with this gesture.


public GestureId id { get; set; }


positionAndForce

Gesture position (x,y) and force (z). Position is in the [-1.0,1.0] range and force is in the [0.0,1.0] range.


public Vector3 positionAndForce { get; set; }


radius

For radial gestures, this is the radius of the gesture. The touchpad is defined as having extents of [-1.0,1.0] so this radius has a range of [0.0,2.0].


public float radius { get; set; }


speed

Speed of gesture. Note that this takes on different meanings depending on the gesture type being performed:


public float speed { get; set; }


state

The state of the gesture.


public GestureState state { get; set; }


type

Type of gesture.


public InputSubsystem.Extensions.TouchpadGesture.Type type { get; set; }

TypeDescription
InputSubsystem.Extensions.TouchpadGesture.TypeRecognized touchpad gesture types. Links to MLInputControllerTouchpadGestureType in ml_input.h.

Public Methods

override bool Equals

public override bool Equals(
object obj
)

Parameters

TypeNameDescription
objectobj

bool Equals

public bool Equals(
TouchpadGestureEvent other
)

Parameters

TypeNameDescription
TouchpadGestureEventotherThe event data related to a Magic Leap Touchpad gesture

TouchpadGestureEvent GetDefault

Gets a default-initialized TouchpadGestureEvent.

public static TouchpadGestureEvent GetDefault()

Returns: A default TouchpadGestureEvent.


override int GetHashCode

public override int GetHashCode()

override string ToString

Generates a new string describing the gestures's properties suitable for debugging purposes.

public override string ToString()

Returns: A string describing the gestures's properties.


TouchpadGestureEvent

Constructs a new TouchpadGestureEvent.

public TouchpadGestureEvent(
GestureId id,
GestureState state,
byte controllerId,
float angle,
InputSubsystem.Extensions.TouchpadGesture.Direction direction,
float distance,
Vector3 positionAndForce,
float radius,
float speed,
InputSubsystem.Extensions.TouchpadGesture.Type type
)

Parameters

TypeNameDescription
GestureIdidThe GestureId associated with the gesture.
GestureStatestateThe GestureState associated with the gesture.
bytecontrollerIdThe controller id associated with this gesture.
floatangleThe angel of the touch of the gesture.
InputSubsystem.Extensions.TouchpadGesture.DirectiondirectionThe direction of the touch of the gesture.
floatdistanceThe distance of the gesture.
Vector3positionAndForceThe Vector3 position and force of the gesture.
floatradiusThe radius of the touch of the gesture.
floatspeedThe speed of the gesture.
InputSubsystem.Extensions.TouchpadGesture.TypetypeThe MLInput.Controller.TouchpadGesture.GestureType type of the gesture.

bool operator!=

public static bool operator!=(
TouchpadGestureEvent lhs,
TouchpadGestureEvent rhs
)

Parameters

TypeNameDescription
TouchpadGestureEventlhsThe event data related to a Magic Leap Touchpad gesture
TouchpadGestureEventrhsThe event data related to a Magic Leap Touchpad gesture

bool operator==

public static bool operator==(
TouchpadGestureEvent lhs,
TouchpadGestureEvent rhs
)

Parameters

TypeNameDescription
TouchpadGestureEventlhsThe event data related to a Magic Leap Touchpad gesture
TouchpadGestureEventrhsThe event data related to a Magic Leap Touchpad gesture

Public Attributes

m_Angle


public float m_Angle;


m_ControllerId


public byte m_ControllerId;


m_Direction


public InputSubsystem.Extensions.TouchpadGesture.Direction m_Direction;

TypeDescription
InputSubsystem.Extensions.TouchpadGesture.DirectionDirection of touchpad gesture. Links to MLInputControllerTouchpadGestureDirection in ml_input.h.

m_Distance


public float m_Distance;


m_Id


public GestureId m_Id;


m_PositionAndForce


public Vector3 m_PositionAndForce;


m_Radius


public float m_Radius;


m_Speed


public float m_Speed;


m_State


public GestureState m_State;


m_Type


public InputSubsystem.Extensions.TouchpadGesture.Type m_Type;

TypeDescription
InputSubsystem.Extensions.TouchpadGesture.TypeRecognized touchpad gesture types. Links to MLInputControllerTouchpadGestureType in ml_input.h.