Class Touchscreen
A multi-touch surface.
Inherited Members
Namespace: UnityEngine.InputSystem
Syntax
public class Touchscreen : Pointer, IInputStateCallbackReceiver
Properties
activeTouches
Array of currently active touches.
Declaration
public ReadOnlyArray<TouchControl> activeTouches { get; }
Property Value
Type | Description |
---|---|
ReadOnlyArray<TouchControl> |
Remarks
This array only contains touches that are either in progress, i.e. have a phase of Began or Moved or Stationary, or that have just ended, i.e. moved to Ended or Canceled this frame.
Does not allocate GC memory.
allTouchControls
Array of all TouchControl on the device.
Declaration
public ReadOnlyArray<TouchControl> allTouchControls { get; }
Property Value
Type | Description |
---|---|
ReadOnlyArray<TouchControl> |
Remarks
Will always contain MaxTouches entries regardless of which touches (if any) are currently in progress.
current
The touchscreen that was added or updated last or null if there is no touchscreen connected to the system.
Declaration
public static Touchscreen current { get; }
Property Value
Type | Description |
---|---|
Touchscreen |
primaryTouch
Declaration
public TouchControl primaryTouch { get; }
Property Value
Type | Description |
---|---|
TouchControl |
Methods
FinishSetup(InputDeviceBuilder)
Declaration
protected override void FinishSetup(InputDeviceBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
InputDeviceBuilder | builder |
Overrides
MakeCurrent()
Declaration
public override void MakeCurrent()
Overrides
OnRemoved()
Declaration
protected override void OnRemoved()
Overrides
Explicit Interface Implementations
IInputStateCallbackReceiver.OnBeforeWriteNewState(Void*, Void*)
Declaration
void IInputStateCallbackReceiver.OnBeforeWriteNewState(void *oldStatePtr, void *newStatePtr)
Parameters
Type | Name | Description |
---|---|---|
System.Void* | oldStatePtr | |
System.Void* | newStatePtr |
Implements
IInputStateCallbackReceiver.OnCarryStateForward(Void*)
Declaration
bool IInputStateCallbackReceiver.OnCarryStateForward(void *statePtr)
Parameters
Type | Name | Description |
---|---|---|
System.Void* | statePtr |
Returns
Type | Description |
---|---|
System.Boolean |
Implements
IInputStateCallbackReceiver.OnReceiveStateWithDifferentFormat(Void*, FourCC, UInt32, ref UInt32)
Declaration
bool IInputStateCallbackReceiver.OnReceiveStateWithDifferentFormat(void *statePtr, FourCC stateFormat, uint stateSize, ref uint offsetToStoreAt)
Parameters
Type | Name | Description |
---|---|---|
System.Void* | statePtr | |
FourCC | stateFormat | |
System.UInt32 | stateSize | |
System.UInt32 | offsetToStoreAt |
Returns
Type | Description |
---|---|
System.Boolean |