Class Touchscreen | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class Touchscreen

    A multi-touch surface.

    Inheritance
    System.Object
    InputControl
    InputDevice
    Pointer
    Touchscreen
    Inherited Members
    Pointer.position
    Pointer.delta
    Pointer.tilt
    Pointer.radius
    Pointer.pressure
    Pointer.twist
    Pointer.pointerId
    Pointer.phase
    Pointer.displayIndex
    Pointer.button
    Pointer.ResetDelta(Void*, InputControl<Single>)
    Pointer.AccumulateDelta(Void*, Void*, InputControl<Single>)
    InputDevice.InvalidDeviceId
    InputDevice.LocalParticipantId
    InputDevice.description
    InputDevice.enabled
    InputDevice.canRunInBackground
    InputDevice.added
    InputDevice.remote
    InputDevice.native
    InputDevice.updateBeforeRender
    InputDevice.id
    InputDevice.lastUpdateTime
    InputDevice.wasUpdatedThisFrame
    InputDevice.allControls
    InputDevice.valueType
    InputDevice.valueSizeInBytes
    InputDevice.all
    InputDevice.ReadValueFromBufferAsObject(Void*, Int32)
    InputDevice.ReadValueFromStateAsObject(Void*)
    InputDevice.ReadValueFromStateIntoBuffer(Void*, Void*, Int32)
    InputDevice.CompareValue(Void*, Void*)
    InputDevice.OnAdded()
    InputDevice.ExecuteCommand<TCommand>(TCommand)
    InputControl.name
    InputControl.displayName
    InputControl.shortDisplayName
    InputControl.path
    InputControl.layout
    InputControl.variants
    InputControl.device
    InputControl.parent
    InputControl.children
    InputControl.usages
    InputControl.aliases
    InputControl.stateBlock
    InputControl.noisy
    InputControl.synthetic
    InputControl.Item[String]
    InputControl.ToString()
    InputControl.EvaluateMagnitude()
    InputControl.EvaluateMagnitude(Void*)
    InputControl.WriteValueFromBufferIntoState(Void*, Int32, Void*)
    InputControl.WriteValueFromObjectIntoState(Object, Void*)
    InputControl.CompareState(Void*, Void*, Void*)
    InputControl.TryGetChildControl(String)
    InputControl.RefreshConfigurationIfNeeded()
    InputControl.RefreshConfiguration()
    InputControl.m_StateBlock
    InputControl.currentStatePtr
    InputControl.previousFrameStatePtr
    InputControl.defaultStatePtr
    InputControl.noiseMaskPtr
    InputControl.stateOffsetRelativeToDeviceRoot
    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
    Pointer.FinishSetup(InputDeviceBuilder)

    MakeCurrent()

    Declaration
    public override void MakeCurrent()
    Overrides
    Pointer.MakeCurrent()

    OnRemoved()

    Declaration
    protected override void OnRemoved()
    Overrides
    Pointer.OnRemoved()

    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.OnBeforeWriteNewState(Void*, Void*)

    IInputStateCallbackReceiver.OnCarryStateForward(Void*)

    Declaration
    bool IInputStateCallbackReceiver.OnCarryStateForward(void *statePtr)
    Parameters
    Type Name Description
    System.Void* statePtr
    Returns
    Type Description
    System.Boolean
    Implements
    IInputStateCallbackReceiver.OnCarryStateForward(Void*)

    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
    Implements
    IInputStateCallbackReceiver.OnReceiveStateWithDifferentFormat(Void*, FourCC, UInt32, ref UInt32)

    Extension Methods

    InputControlExtensions.IsActuated(InputControl, Single)
    InputControlExtensions.ReadValueAsObject(InputControl)
    InputControlExtensions.ReadValueIntoBuffer(InputControl, Void*, Int32)
    InputControlExtensions.ReadDefaultValue(InputControl, Void*, Int32)
    InputControlExtensions.ReadDefaultValueAsObject(InputControl)
    InputControlExtensions.WriteValueFromObjectIntoEvent(InputControl, InputEventPtr, Object)
    InputControlExtensions.WriteValueIntoState(InputControl, Void*)
    InputControlExtensions.WriteValueIntoState<TValue>(InputControl, TValue, Void*)
    InputControlExtensions.WriteValueIntoEvent<TValue>(InputControl, TValue, InputEventPtr)
    InputControlExtensions.CheckStateIsAtDefault(InputControl)
    InputControlExtensions.CheckStateIsAtDefault(InputControl, Void*, Void*)
    InputControlExtensions.CheckStateIsAtDefaultIgnoringNoise(InputControl)
    InputControlExtensions.CheckStateIsAtDefaultIgnoringNoise(InputControl, Void*)
    InputControlExtensions.CompareStateIgnoringNoise(InputControl, Void*)
    InputControlExtensions.CompareState(InputControl, Void*, Void*)
    InputControlExtensions.HasValueChangeInState(InputControl, Void*)
    InputControlExtensions.HasValueChangeInEvent(InputControl, InputEventPtr)
    InputControlExtensions.GetStatePtrFromStateEvent(InputControl, InputEventPtr)
    InputControlExtensions.FindControlsRecursive<TControl>(InputControl, IList<TControl>, Func<TControl, Boolean>)
    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