Inheritance
RecordableInput
public class RecordableInput
Properties
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
Number of acceleration measurements which occurred during last frame.
Not supported with Recorded Playback.
Declaration
public static int accelerationEventCount { get; }
Property Value
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
Is any key or mouse button currently held down? (Read Only)
Not supported with Recorded Playback.
Declaration
public static bool anyKey { get; }
Property Value
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
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
Property for accessing compass (handheld devices only). (Read Only)
Not supported with Recorded Playback.
Declaration
public static Compass compass { get; }
Property Value
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
The current text input position used by IMEs to open windows.
Not supported with Recorded Playback.
Declaration
public static Vector2 compositionCursorPos { get; }
Property Value
The current IME composition string being typed by the user.
Not supported with Recorded Playback.
Declaration
public static string compositionString { get; }
Property Value
Device physical orientation as reported by OS. (Read Only)
Not supported with Recorded Playback.
Declaration
public static DeviceOrientation deviceOrientation { get; }
Property Value
Returns default gyroscope.
Not supported with Recorded Playback.
Declaration
public static Gyroscope gyro { get; }
Property Value
Controls enabling and disabling of IME input composition.
Not supported with Recorded Playback.
Declaration
public static IMECompositionMode imeCompositionMode { get; }
Property Value
Does the user have an IME keyboard input source selected?
Not supported with Recorded Playback.
Declaration
public static bool imeIsSelected { get; }
Property Value
Returns the keyboard input entered this frame. (Read Only)
Not supported with Recorded Playback.
Declaration
public static string inputString { get; }
Property Value
The current mouse position in pixel coordinates. (Read Only)
Declaration
public static Vector3 mousePosition { get; }
Property Value
Indicates if a mouse device is detected.
Not supported with Recorded Playback.
Declaration
public static bool mousePresent { get; }
Property Value
The current mouse scroll delta. (Read Only)
Not supported with Recorded Playback.
Declaration
public static Vector2 mouseScrollDelta { get; }
Property Value
Property indicating whether the system handles multiple touches.
Not supported with Recorded Playback.
Declaration
public static bool multiTouchEnabled { get; }
Property Value
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
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
Number of touches. Guaranteed not to change throughout the frame. (Read Only)
Declaration
public static int touchCount { get; }
Property Value
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
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
Methods
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
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
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
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.
|
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
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
Returns an array of strings describing the connected joysticks.
Not supported with Recorded Playback.
Declaration
public static string[] GetJoystickNames()
Returns
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
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
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
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
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
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
Returns whether the given mouse button is held down.
Declaration
public static bool GetMouseButton(int button)
Parameters
Type |
Name |
Description |
Int32 |
button |
|
Returns
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
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
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.
|
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()