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

    Class InputTestRuntime

    An implementation of IInputRuntime for use during tests.

    Inheritance
    System.Object
    InputTestRuntime
    Namespace: UnityEngine.InputSystem
    Syntax
    public class InputTestRuntime : IInputRuntime, IDisposable
    Remarks

    This class is only available in the editor and in development players.

    The test runtime replaces the services usually supplied by .

    Properties

    advanceTimeEachDynamicUpdate

    Declaration
    public double advanceTimeEachDynamicUpdate { get; set; }
    Property Value
    Type Description
    System.Double

    currentTime

    Declaration
    public double currentTime { get; set; }
    Property Value
    Type Description
    System.Double
    Implements
    IInputRuntime.currentTime

    currentTimeForFixedUpdate

    Declaration
    public double currentTimeForFixedUpdate { get; set; }
    Property Value
    Type Description
    System.Double
    Implements
    IInputRuntime.currentTimeForFixedUpdate

    currentTimeOffsetToRealtimeSinceStartup

    Declaration
    public double currentTimeOffsetToRealtimeSinceStartup { get; set; }
    Property Value
    Type Description
    System.Double
    Implements
    IInputRuntime.currentTimeOffsetToRealtimeSinceStartup

    isInBatchMode

    Declaration
    public bool isInBatchMode { get; set; }
    Property Value
    Type Description
    System.Boolean
    Implements
    IInputRuntime.isInBatchMode

    onBeforeUpdate

    Declaration
    public Action<InputUpdateType> onBeforeUpdate { get; set; }
    Property Value
    Type Description
    System.Action<InputUpdateType>
    Implements
    IInputRuntime.onBeforeUpdate

    onDeviceDiscovered

    Declaration
    public Action<int, string> onDeviceDiscovered { get; set; }
    Property Value
    Type Description
    System.Action<System.Int32, System.String>
    Implements
    IInputRuntime.onDeviceDiscovered

    onPlayerFocusChanged

    Declaration
    public Action<bool> onPlayerFocusChanged { get; set; }
    Property Value
    Type Description
    System.Action<System.Boolean>
    Implements
    IInputRuntime.onPlayerFocusChanged

    onShouldRunUpdate

    Declaration
    public Func<InputUpdateType, bool> onShouldRunUpdate { get; set; }
    Property Value
    Type Description
    System.Func<InputUpdateType, System.Boolean>
    Implements
    IInputRuntime.onShouldRunUpdate

    onShutdown

    Declaration
    public Action onShutdown { get; set; }
    Property Value
    Type Description
    System.Action
    Implements
    IInputRuntime.onShutdown

    onUpdate

    Declaration
    public InputUpdateDelegate onUpdate { get; set; }
    Property Value
    Type Description
    InputUpdateDelegate
    Implements
    IInputRuntime.onUpdate

    pollingFrequency

    Declaration
    public float pollingFrequency { get; set; }
    Property Value
    Type Description
    System.Single
    Implements
    IInputRuntime.pollingFrequency

    screenOrientation

    Declaration
    public ScreenOrientation screenOrientation { get; set; }
    Property Value
    Type Description
    ScreenOrientation
    Implements
    IInputRuntime.screenOrientation

    userAccountPairings

    Declaration
    public List<InputTestRuntime.PairedUser> userAccountPairings { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<InputTestRuntime.PairedUser>

    Methods

    AllocateDeviceId()

    Declaration
    public int AllocateDeviceId()
    Returns
    Type Description
    System.Int32
    Implements
    IInputRuntime.AllocateDeviceId()

    AssociateInputDeviceWithUser(Int32, UInt64, String, String)

    Declaration
    public void AssociateInputDeviceWithUser(int deviceId, ulong userHandle, string userName = null, string userId = null)
    Parameters
    Type Name Description
    System.Int32 deviceId
    System.UInt64 userHandle
    System.String userName
    System.String userId

    AssociateInputDeviceWithUser(InputDevice, UInt64, String, String)

    Declaration
    public void AssociateInputDeviceWithUser(InputDevice device, ulong userHandle, string userName = null, string userId = null)
    Parameters
    Type Name Description
    InputDevice device
    System.UInt64 userHandle
    System.String userName
    System.String userId

    DeviceCommand(Int32, InputDeviceCommand*)

    Declaration
    public long DeviceCommand(int deviceId, InputDeviceCommand*commandPtr)
    Parameters
    Type Name Description
    System.Int32 deviceId
    InputDeviceCommand* commandPtr
    Returns
    Type Description
    System.Int64
    Implements
    IInputRuntime.DeviceCommand(Int32, InputDeviceCommand*)

    Dispose()

    Declaration
    public void Dispose()

    Finalize()

    Declaration
    protected void Finalize()

    InvokePlayerFocusChanged(Boolean)

    Declaration
    public void InvokePlayerFocusChanged(bool newFocusState)
    Parameters
    Type Name Description
    System.Boolean newFocusState

    PlayerFocusGained()

    Declaration
    public void PlayerFocusGained()

    PlayerFocusLost()

    Declaration
    public void PlayerFocusLost()

    QueueEvent(InputEvent*)

    Declaration
    public void QueueEvent(InputEvent*eventPtr)
    Parameters
    Type Name Description
    InputEvent* eventPtr
    Implements
    IInputRuntime.QueueEvent(InputEvent*)

    ReportInputDeviceRemoved(Int32)

    Declaration
    public void ReportInputDeviceRemoved(int deviceId)
    Parameters
    Type Name Description
    System.Int32 deviceId

    ReportInputDeviceRemoved(InputDevice)

    Declaration
    public void ReportInputDeviceRemoved(InputDevice device)
    Parameters
    Type Name Description
    InputDevice device

    ReportNewInputDevice(String, Int32)

    Declaration
    public int ReportNewInputDevice(string deviceDescriptor, int deviceId = 0)
    Parameters
    Type Name Description
    System.String deviceDescriptor
    System.Int32 deviceId
    Returns
    Type Description
    System.Int32

    ReportNewInputDevice(InputDeviceDescription, Int32, UInt64, String, String)

    Declaration
    public int ReportNewInputDevice(InputDeviceDescription description, int deviceId = 0, ulong userHandle = 0UL, string userName = null, string userId = null)
    Parameters
    Type Name Description
    InputDeviceDescription description
    System.Int32 deviceId
    System.UInt64 userHandle
    System.String userName
    System.String userId
    Returns
    Type Description
    System.Int32

    ReportNewInputDevice<TDevice>(Int32, UInt64, String, String)

    Declaration
    public int ReportNewInputDevice<TDevice>(int deviceId = 0, ulong userHandle = 0UL, string userName = null, string userId = null)
        where TDevice : InputDevice
    Parameters
    Type Name Description
    System.Int32 deviceId
    System.UInt64 userHandle
    System.String userName
    System.String userId
    Returns
    Type Description
    System.Int32
    Type Parameters
    Name Description
    TDevice

    SetDeviceCommandCallback(Int32, InputTestRuntime.DeviceCommandCallback)

    Declaration
    public void SetDeviceCommandCallback(int deviceId, InputTestRuntime.DeviceCommandCallback callback)
    Parameters
    Type Name Description
    System.Int32 deviceId
    InputTestRuntime.DeviceCommandCallback callback

    SetDeviceCommandCallback(InputDevice, InputTestRuntime.DeviceCommandCallback)

    Declaration
    public void SetDeviceCommandCallback(InputDevice device, InputTestRuntime.DeviceCommandCallback callback)
    Parameters
    Type Name Description
    InputDevice device
    InputTestRuntime.DeviceCommandCallback callback

    SetDeviceCommandCallback<TCommand>(Int32, TCommand)

    Declaration
    public void SetDeviceCommandCallback<TCommand>(int deviceId, TCommand result)
        where TCommand : struct, IInputDeviceCommandInfo
    Parameters
    Type Name Description
    System.Int32 deviceId
    TCommand result
    Type Parameters
    Name Description
    TCommand

    Update(InputUpdateType)

    Declaration
    public void Update(InputUpdateType type)
    Parameters
    Type Name Description
    InputUpdateType type
    Implements
    IInputRuntime.Update(InputUpdateType)

    See Also

    runtime
    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