docs.unity3d.com
    Show / Hide Table of Contents

    Class RecordableInput

    Inheritance
    Object
    RecordableInput
    Namespace: UnityEngine.EventSystems
    Syntax
    public class RecordableInput

    Properties

    acceleration

    Last measured linear acceleration of a device in three-dimensional space. (Read Only) Not supported with Recorded Playback.

    Declaration
    public static Vector3 acceleration { get; }
    Property Value
    Type Description
    Vector3

    accelerationEventCount

    Number of acceleration measurements which occurred during last frame. Not supported with Recorded Playback.

    Declaration
    public static int accelerationEventCount { get; }
    Property Value
    Type Description
    Int32

    accelerationEvents

    Returns list of acceleration measurements which occurred during the last frame. (Read Only) (Allocates temporary variables). Not supported with Recorded Playback.

    Declaration
    public static AccelerationEvent[] accelerationEvents { get; }
    Property Value
    Type Description
    AccelerationEvent[]

    anyKey

    Is any key or mouse button currently held down? (Read Only) Not supported with Recorded Playback.

    Declaration
    public static bool anyKey { get; }
    Property Value
    Type Description
    Boolean

    anyKeyDown

    Returns true the first frame the user hits any key or mouse button. (Read Only) Not supported with Recorded Playback.

    Declaration
    public static bool anyKeyDown { get; }
    Property Value
    Type Description
    Boolean

    backButtonLeavesApp

    Should Back button quit the application? Only usable on Android, Windows Phone or Windows Tablets. Not supported with Recorded Playback.

    Declaration
    public static bool backButtonLeavesApp { get; }
    Property Value
    Type Description
    Boolean

    compass

    Property for accessing compass (handheld devices only). (Read Only) Not supported with Recorded Playback.

    Declaration
    public static Compass compass { get; }
    Property Value
    Type Description
    Compass

    compensateSensors

    This property controls if input sensors should be compensated for screen orientation. Not supported with Recorded Playback.

    Declaration
    public static bool compensateSensors { get; }
    Property Value
    Type Description
    Boolean

    compositionCursorPos

    The current text input position used by IMEs to open windows. Not supported with Recorded Playback.

    Declaration
    public static Vector2 compositionCursorPos { get; }
    Property Value
    Type Description
    Vector2

    compositionString

    The current IME composition string being typed by the user. Not supported with Recorded Playback.

    Declaration
    public static string compositionString { get; }
    Property Value
    Type Description
    String

    deviceOrientation

    Device physical orientation as reported by OS. (Read Only) Not supported with Recorded Playback.

    Declaration
    public static DeviceOrientation deviceOrientation { get; }
    Property Value
    Type Description
    DeviceOrientation

    gyro

    Returns default gyroscope. Not supported with Recorded Playback.

    Declaration
    public static Gyroscope gyro { get; }
    Property Value
    Type Description
    Gyroscope

    imeCompositionMode

    Controls enabling and disabling of IME input composition. Not supported with Recorded Playback.

    Declaration
    public static IMECompositionMode imeCompositionMode { get; }
    Property Value
    Type Description
    IMECompositionMode

    imeIsSelected

    Does the user have an IME keyboard input source selected? Not supported with Recorded Playback.

    Declaration
    public static bool imeIsSelected { get; }
    Property Value
    Type Description
    Boolean

    inputString

    Returns the keyboard input entered this frame. (Read Only) Not supported with Recorded Playback.

    Declaration
    public static string inputString { get; }
    Property Value
    Type Description
    String

    mousePosition

    The current mouse position in pixel coordinates. (Read Only)

    Declaration
    public static Vector3 mousePosition { get; }
    Property Value
    Type Description
    Vector3

    mousePresent

    Indicates if a mouse device is detected. Not supported with Recorded Playback.

    Declaration
    public static bool mousePresent { get; }
    Property Value
    Type Description
    Boolean

    mouseScrollDelta

    The current mouse scroll delta. (Read Only) Not supported with Recorded Playback.

    Declaration
    public static Vector2 mouseScrollDelta { get; }
    Property Value
    Type Description
    Vector2

    multiTouchEnabled

    Property indicating whether the system handles multiple touches. Not supported with Recorded Playback.

    Declaration
    public static bool multiTouchEnabled { get; }
    Property Value
    Type Description
    Boolean

    simulateMouseWithTouches

    Enables/Disables mouse simulation with touches. By default this option is enabled. Not supported with Recorded Playback.

    Declaration
    public static bool simulateMouseWithTouches { get; }
    Property Value
    Type Description
    Boolean

    stylusTouchSupported

    Returns true when Stylus Touch is supported by a device or platform. Not supported with Recorded Playback.

    Declaration
    public static bool stylusTouchSupported { get; }
    Property Value
    Type Description
    Boolean

    touchCount

    Number of touches. Guaranteed not to change throughout the frame. (Read Only)

    Declaration
    public static int touchCount { get; }
    Property Value
    Type Description
    Int32

    touches

    Returns list of objects representing status of all touches during last frame. (Read Only) (Allocates temporary variables).

    Declaration
    public static Touch[] touches { get; }
    Property Value
    Type Description
    Touch[]

    touchPressureSupported

    Bool value which let's users check if touch pressure is supported. Not supported with Recorded Playback.

    Declaration
    public static bool touchPressureSupported { get; }
    Property Value
    Type Description
    Boolean

    Methods

    GetAccelerationEvent(Int32)

    Returns specific acceleration measurement which occurred during last frame. (Does not allocate temporary variables). Not supported with Recorded Playback.

    Declaration
    public static AccelerationEvent GetAccelerationEvent(int index)
    Parameters
    Type Name Description
    Int32 index
    Returns
    Type Description
    AccelerationEvent

    GetAxis(String)

    Returns the value of the virtual axis identified by axisName. Not supported with Recorded Playback.

    Declaration
    public static float GetAxis(string axisName)
    Parameters
    Type Name Description
    String axisName
    Returns
    Type Description
    Single

    GetAxisRaw(String)

    Returns the value of the virtual axis identified by axisName with no smoothing filtering applied. Not supported with Recorded Playback.

    Declaration
    public static float GetAxisRaw(string axisName)
    Parameters
    Type Name Description
    String axisName
    Returns
    Type Description
    Single

    GetButton(String)

    Returns true while the virtual button identified by buttonName is held down.

    Declaration
    public static bool GetButton(string buttonName)
    Parameters
    Type Name Description
    String buttonName

    The name of the button such as Jump.

    Returns
    Type Description
    Boolean

    True when an axis has been pressed and not released.

    GetButtonDown(String)

    Returns true during the frame the user pressed down the virtual button identified by buttonName.

    Declaration
    public static bool GetButtonDown(string buttonName)
    Parameters
    Type Name Description
    String buttonName
    Returns
    Type Description
    Boolean

    GetButtonUp(String)

    Returns true the first frame the user releases the virtual button identified by buttonName.

    Declaration
    public static bool GetButtonUp(string buttonName)
    Parameters
    Type Name Description
    String buttonName
    Returns
    Type Description
    Boolean

    GetJoystickNames()

    Returns an array of strings describing the connected joysticks. Not supported with Recorded Playback.

    Declaration
    public static string[] GetJoystickNames()
    Returns
    Type Description
    String[]

    GetKey(String)

    Returns true while the user holds down the key identified by name.

    Declaration
    public static bool GetKey(string name)
    Parameters
    Type Name Description
    String name
    Returns
    Type Description
    Boolean

    GetKey(KeyCode)

    Returns true while the user holds down the key identified by the key KeyCode enum parameter.

    Declaration
    public static bool GetKey(KeyCode keyCode)
    Parameters
    Type Name Description
    KeyCode keyCode
    Returns
    Type Description
    Boolean

    GetKeyDown(String)

    Returns true during the frame the user starts pressing down the key identified by name.

    Declaration
    public static bool GetKeyDown(string name)
    Parameters
    Type Name Description
    String name
    Returns
    Type Description
    Boolean

    GetKeyDown(KeyCode)

    Returns true during the frame the user starts pressing down the key identified by the key KeyCode enum parameter.

    Declaration
    public static bool GetKeyDown(KeyCode keyCode)
    Parameters
    Type Name Description
    KeyCode keyCode
    Returns
    Type Description
    Boolean

    GetKeyUp(String)

    Returns true during the frame the user releases the key identified by name.

    Declaration
    public static bool GetKeyUp(string name)
    Parameters
    Type Name Description
    String name
    Returns
    Type Description
    Boolean

    GetKeyUp(KeyCode)

    Returns true during the frame the user releases the key identified by the key KeyCode enum parameter.

    Declaration
    public static bool GetKeyUp(KeyCode keyCode)
    Parameters
    Type Name Description
    KeyCode keyCode
    Returns
    Type Description
    Boolean

    GetMouseButton(Int32)

    Returns whether the given mouse button is held down.

    Declaration
    public static bool GetMouseButton(int button)
    Parameters
    Type Name Description
    Int32 button
    Returns
    Type Description
    Boolean

    GetMouseButtonDown(Int32)

    Returns true during the frame the user pressed the given mouse button.

    Declaration
    public static bool GetMouseButtonDown(int button)
    Parameters
    Type Name Description
    Int32 button
    Returns
    Type Description
    Boolean

    GetMouseButtonUp(Int32)

    Returns true during the frame the user releases the given mouse button.

    Declaration
    public static bool GetMouseButtonUp(int button)
    Parameters
    Type Name Description
    Int32 button
    Returns
    Type Description
    Boolean

    GetTouch(Int32)

    Call Input.GetTouch to obtain a Touch struct.

    Declaration
    public static Touch GetTouch(int index)
    Parameters
    Type Name Description
    Int32 index

    The touch input on the device screen.

    Returns
    Type Description
    Touch

    Touch details in the struct.

    ResetInputAxes()

    Resets all input. After ResetInputAxes all axes return to 0 and all buttons return to 0 for one frame. Not supported by Recorded Playback.

    Declaration
    public static void ResetInputAxes()
    Back to top
    Terms of use
    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