Struct StateEvent
A complete state snapshot for an entire input device.
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 StateEvent : IInputEventTypeInfo
Remarks
This is a variable-sized event.
Fields
baseEvent
Declaration
public InputEvent baseEvent
Field Value
Type | Description |
---|---|
InputEvent |
stateData
Declaration
public byte *stateData
Field Value
Type | Description |
---|---|
System.Byte* |
stateFormat
Type code for the state stored in the event.
Declaration
public FourCC stateFormat
Field Value
Type | Description |
---|---|
FourCC |
Type
Declaration
public const int Type = 1398030676
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
state
Declaration
public void *state { get; }
Property Value
Type | Description |
---|---|
System.Void* |
stateSizeInBytes
Declaration
public uint stateSizeInBytes { get; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Methods
From(InputDevice, out InputEventPtr, Allocator)
Read the current state of device and create a state event from it.
Declaration
public static NativeArray<byte> From(InputDevice device, out InputEventPtr eventPtr, Allocator allocator = null)
Parameters
Type | Name | Description |
---|---|---|
InputDevice | device | Device to grab the state from. Must be a device that has been added to the system. |
InputEventPtr | eventPtr | Receives a pointer to the newly created state event. |
Allocator | allocator | Which native allocator to allocate memory for the event from. By default, the buffer is
allocated as temporary memory ( |
Returns
Type | Description |
---|---|
NativeArray<System.Byte> | Buffer of unmanaged memory allocated for the event. |
From(InputEventPtr)
Declaration
public static StateEvent*From(InputEventPtr ptr)
Parameters
Type | Name | Description |
---|---|---|
InputEventPtr | ptr |
Returns
Type | Description |
---|---|
StateEvent* |
GetEventSizeWithPayload<TState>()
Declaration
public static int GetEventSizeWithPayload<TState>()where TState : struct
Returns
Type | Description |
---|---|
System.Int32 |
Type Parameters
Name | Description |
---|---|
TState |
GetTypeStatic()
Declaration
public FourCC GetTypeStatic()
Returns
Type | Description |
---|---|
FourCC |
Implements
ToEventPtr()
Declaration
public InputEventPtr ToEventPtr()
Returns
Type | Description |
---|---|
InputEventPtr |