Struct InputEventPtr | Input System | 1.0.2
docs.unity3d.com
    Show / Hide Table of Contents

    Struct InputEventPtr

    Pointer to an InputEvent. Makes it easier to work with InputEvents and hides the unsafe operations necessary to work with them.

    Namespace: UnityEngine.InputSystem.LowLevel
    Syntax
    public struct InputEventPtr : IEquatable<InputEventPtr>
    Remarks

    Note that event pointers generally refer to event buffers that are continually reused. This means that event pointers should not be held on to. Instead, to hold onto event data, manually copy an event to a buffer.

    Constructors

    InputEventPtr(InputEvent*)

    Initialize the pointer to refer to the given event.

    Declaration
    public InputEventPtr(InputEvent*eventPtr)
    Parameters
    Type Name Description
    InputEvent* eventPtr

    Pointer to an event. Can be null.

    Properties

    data

    Declaration
    public InputEvent*data { get; }
    Property Value
    Type Description
    InputEvent*

    deviceId

    Declaration
    public int deviceId { get; set; }
    Property Value
    Type Description
    Int32

    handled

    Declaration
    public bool handled { get; set; }
    Property Value
    Type Description
    Boolean
    Exceptions
    Type Condition
    InvalidOperationException

    id

    Declaration
    public int id { get; set; }
    Property Value
    Type Description
    Int32

    sizeInBytes

    Declaration
    public uint sizeInBytes { get; }
    Property Value
    Type Description
    UInt32

    time

    Declaration
    public double time { get; set; }
    Property Value
    Type Description
    Double

    type

    Declaration
    public FourCC type { get; }
    Property Value
    Type Description
    FourCC

    valid

    Whether the pointer is not null.

    Declaration
    public bool valid { get; }
    Property Value
    Type Description
    Boolean

    True if the struct refers to an event.

    Methods

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean
    Overrides
    ValueType.Equals(Object)

    Equals(InputEventPtr)

    Declaration
    public bool Equals(InputEventPtr other)
    Parameters
    Type Name Description
    InputEventPtr other
    Returns
    Type Description
    Boolean
    Implements
    IEquatable<T>.Equals(T)

    From(InputEvent*)

    Declaration
    public static InputEventPtr From(InputEvent*eventPtr)
    Parameters
    Type Name Description
    InputEvent* eventPtr
    Returns
    Type Description
    InputEventPtr

    FromInputEventPtr(InputEventPtr)

    Declaration
    public static InputEvent*FromInputEventPtr(InputEventPtr eventPtr)
    Parameters
    Type Name Description
    InputEventPtr eventPtr
    Returns
    Type Description
    InputEvent*

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32
    Overrides
    ValueType.GetHashCode()

    IsA<TOtherEvent>()

    Declaration
    public bool IsA<TOtherEvent>()
        where TOtherEvent : struct, IInputEventTypeInfo
    Returns
    Type Description
    Boolean
    Type Parameters
    Name Description
    TOtherEvent

    Next()

    Declaration
    public InputEventPtr Next()
    Returns
    Type Description
    InputEventPtr

    ToPointer()

    Return the plain pointer wrapped around by the struct.

    Declaration
    public InputEvent*ToPointer()
    Returns
    Type Description
    InputEvent*

    A plain pointer. Can be null.

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    ValueType.ToString()

    Operators

    Equality(InputEventPtr, InputEventPtr)

    Declaration
    public static bool operator ==(InputEventPtr left, InputEventPtr right)
    Parameters
    Type Name Description
    InputEventPtr left
    InputEventPtr right
    Returns
    Type Description
    Boolean

    Implicit(InputEvent* to InputEventPtr)

    Declaration
    public static implicit operator InputEventPtr(InputEvent*eventPtr)
    Parameters
    Type Name Description
    InputEvent* eventPtr
    Returns
    Type Description
    InputEventPtr

    Implicit(InputEventPtr to InputEvent*)

    Declaration
    public static implicit operator InputEvent*(InputEventPtr eventPtr)
    Parameters
    Type Name Description
    InputEventPtr eventPtr
    Returns
    Type Description
    InputEvent*

    Inequality(InputEventPtr, InputEventPtr)

    Declaration
    public static bool operator !=(InputEventPtr left, InputEventPtr right)
    Parameters
    Type Name Description
    InputEventPtr left
    InputEventPtr right
    Returns
    Type Description
    Boolean
    In This Article
    • Constructors
      • InputEventPtr(InputEvent*)
    • Properties
      • data
      • deviceId
      • handled
      • id
      • sizeInBytes
      • time
      • type
      • valid
    • Methods
      • Equals(Object)
      • Equals(InputEventPtr)
      • From(InputEvent*)
      • FromInputEventPtr(InputEventPtr)
      • GetHashCode()
      • IsA<TOtherEvent>()
      • Next()
      • ToPointer()
      • ToString()
    • Operators
      • Equality(InputEventPtr, InputEventPtr)
      • Implicit(InputEvent* to InputEventPtr)
      • Implicit(InputEventPtr to InputEvent*)
      • Inequality(InputEventPtr, InputEventPtr)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023