docs.unity3d.com
    Show / Hide Table of Contents

    Struct InputDeviceCommand

    Data header for a command send to an InputDevice.

    Namespace: UnityEngine.InputSystem.LowLevel
    Syntax
    public struct InputDeviceCommand : IInputDeviceCommandInfo
    Remarks

    Commands are essentially synchronously processed events send directly to a specific device. Their primary use is to expose device-specific functions without having to extend the C# API used to communicate between input code and backend device implementations (which may sit in native code).

    Like input events, device commands use FourCC codes to indicate their type.

    Constructors

    InputDeviceCommand(FourCC, Int32)

    Declaration
    public InputDeviceCommand(FourCC type, int sizeInBytes = null)
    Parameters
    Type Name Description
    FourCC type
    Int32 sizeInBytes

    Fields

    BaseCommandSize

    Declaration
    public const int BaseCommandSize = null
    Field Value
    Type Description
    Int32

    GenericFailure

    Generic failure code for ExecuteCommand<TCommand>(ref TCommand) calls.

    Declaration
    public const long GenericFailure = null
    Field Value
    Type Description
    Int64
    Remarks

    Any negative return value for an ExecuteCommand<TCommand>(ref TCommand) call should be considered failure.

    GenericSuccess

    Declaration
    public const long GenericSuccess = null
    Field Value
    Type Description
    Int64

    sizeInBytes

    Declaration
    public int sizeInBytes
    Field Value
    Type Description
    Int32

    type

    Declaration
    public FourCC type
    Field Value
    Type Description
    FourCC

    Properties

    payloadPtr

    Declaration
    public void *payloadPtr { get; }
    Property Value
    Type Description
    Void*

    payloadSizeInBytes

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

    typeStatic

    Declaration
    public FourCC typeStatic { get; }
    Property Value
    Type Description
    FourCC
    Implements
    IInputDeviceCommandInfo.typeStatic

    Methods

    AllocateNative(FourCC, Int32)

    Declaration
    public static NativeArray<byte> AllocateNative(FourCC type, int payloadSize)
    Parameters
    Type Name Description
    FourCC type
    Int32 payloadSize
    Returns
    Type Description
    NativeArray<Byte>
    In This Article
    • Constructors
      • InputDeviceCommand(FourCC, Int32)
    • Fields
      • BaseCommandSize
      • GenericFailure
      • GenericSuccess
      • sizeInBytes
      • type
    • Properties
      • payloadPtr
      • payloadSizeInBytes
      • typeStatic
    • Methods
      • AllocateNative(FourCC, Int32)
    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