Struct InputStateBlock | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Struct InputStateBlock

    Information about a memory region storing state.

    Inherited Members
    System.ValueType.Equals(System.Object)
    System.ValueType.GetHashCode()
    System.ValueType.ToString()
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetType()
    Namespace: UnityEngine.Experimental.Input.LowLevel
    Syntax
    public struct InputStateBlock
    Remarks

    Input state is kept in raw memory blocks. All state is centrally managed by InputManager; controls cannot keep their own independent state.

    Each state block is tagged with a format code indicating the storage format used for the memory block. This can either be one out of a set of primitive formats (such as "INT") or a custom format code indicating a more complex format.

    Memory using primitive formats can be converted to and from primitive values directly by this struct.

    State memory is bit-addressable, meaning that it can be offset from a byte address in bits (bitOffset) and is sized in bits instead of bytes (sizeInBits). However, in practice, bit-addressing memory reads and writes are only supported on the kTypeBit.

    Input state memory is restricted to a maximum of 4GB in size. Offsets are recorded in 32 bits.

    Fields

    bitOffset

    Declaration
    public uint bitOffset
    Field Value
    Type Description
    System.UInt32

    byteOffset

    Declaration
    public uint byteOffset
    Field Value
    Type Description
    System.UInt32

    format

    Type identifier for the memory layout used by the state.

    Declaration
    public FourCC format
    Field Value
    Type Description
    FourCC
    Remarks

    Used for safety checks to make sure that when the system copies state memory, it copies between compatible layouts. If set to a primitive state format, also used to determine the size of the state block.

    kAutomaticOffset

    Declaration
    public const uint kAutomaticOffset = 4294967294U
    Field Value
    Type Description
    System.UInt32

    kInvalidOffset

    Declaration
    public const uint kInvalidOffset = 4294967295U
    Field Value
    Type Description
    System.UInt32

    kTypeBit

    Declaration
    public static FourCC kTypeBit
    Field Value
    Type Description
    FourCC

    kTypeByte

    Declaration
    public static FourCC kTypeByte
    Field Value
    Type Description
    FourCC

    kTypeDouble

    Declaration
    public static FourCC kTypeDouble
    Field Value
    Type Description
    FourCC

    kTypeFloat

    Declaration
    public static FourCC kTypeFloat
    Field Value
    Type Description
    FourCC

    kTypeInt

    Declaration
    public static FourCC kTypeInt
    Field Value
    Type Description
    FourCC

    kTypeLong

    Declaration
    public static FourCC kTypeLong
    Field Value
    Type Description
    FourCC

    kTypeQuaternion

    Declaration
    public static FourCC kTypeQuaternion
    Field Value
    Type Description
    FourCC

    kTypeSBit

    Declaration
    public static FourCC kTypeSBit
    Field Value
    Type Description
    FourCC

    kTypeSByte

    Declaration
    public static FourCC kTypeSByte
    Field Value
    Type Description
    FourCC

    kTypeShort

    Declaration
    public static FourCC kTypeShort
    Field Value
    Type Description
    FourCC

    kTypeUInt

    Declaration
    public static FourCC kTypeUInt
    Field Value
    Type Description
    FourCC

    kTypeULong

    Declaration
    public static FourCC kTypeULong
    Field Value
    Type Description
    FourCC

    kTypeUShort

    Declaration
    public static FourCC kTypeUShort
    Field Value
    Type Description
    FourCC

    kTypeVector2

    Declaration
    public static FourCC kTypeVector2
    Field Value
    Type Description
    FourCC

    kTypeVector2Byte

    Declaration
    public static FourCC kTypeVector2Byte
    Field Value
    Type Description
    FourCC

    kTypeVector2Short

    Declaration
    public static FourCC kTypeVector2Short
    Field Value
    Type Description
    FourCC

    kTypeVector3

    Declaration
    public static FourCC kTypeVector3
    Field Value
    Type Description
    FourCC

    kTypeVector3Byte

    Declaration
    public static FourCC kTypeVector3Byte
    Field Value
    Type Description
    FourCC

    kTypeVector3Short

    Declaration
    public static FourCC kTypeVector3Short
    Field Value
    Type Description
    FourCC

    sizeInBits

    Declaration
    public uint sizeInBits
    Field Value
    Type Description
    System.UInt32

    Methods

    CopyToFrom(Void*, Void*)

    Declaration
    public void CopyToFrom(void *toStatePtr, void *fromStatePtr)
    Parameters
    Type Name Description
    System.Void* toStatePtr
    System.Void* fromStatePtr

    GetPrimitiveFormatFromType(Type)

    Declaration
    public static FourCC GetPrimitiveFormatFromType(Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    FourCC

    GetSizeOfPrimitiveFormatInBits(FourCC)

    Declaration
    public static int GetSizeOfPrimitiveFormatInBits(FourCC type)
    Parameters
    Type Name Description
    FourCC type
    Returns
    Type Description
    System.Int32

    Read(Void*)

    Declaration
    public PrimitiveValue Read(void *statePtr)
    Parameters
    Type Name Description
    System.Void* statePtr
    Returns
    Type Description
    PrimitiveValue

    ReadFloat(Void*)

    Declaration
    public float ReadFloat(void *statePtr)
    Parameters
    Type Name Description
    System.Void* statePtr
    Returns
    Type Description
    System.Single

    ReadInt(Void*)

    Declaration
    public int ReadInt(void *statePtr)
    Parameters
    Type Name Description
    System.Void* statePtr
    Returns
    Type Description
    System.Int32

    Write(Void*, PrimitiveValue)

    Declaration
    public void Write(void *statePtr, PrimitiveValue value)
    Parameters
    Type Name Description
    System.Void* statePtr
    PrimitiveValue value

    WriteFloat(Void*, Single)

    Declaration
    public void WriteFloat(void *statePtr, float value)
    Parameters
    Type Name Description
    System.Void* statePtr
    System.Single value

    WriteInt(Void*, Int32)

    Declaration
    public void WriteInt(void *statePtr, int value)
    Parameters
    Type Name Description
    System.Void* statePtr
    System.Int32 value
    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