Input
Declaration
public class InputSummary
For the most part, a straight pass-through wrapper of the UnityEngine.Input class. However, if AR is running using Playback, then Input.location and Input.compass will return Playback-compatible objects that return values from recorded datasets.
Properties
| Name | Type | Summary |
|---|---|---|
| static readonly acceleration | Vector3 | Last measured linear acceleration of a device in three-dimensional space. (Read Only) |
| static readonly accelerationEventCount | int | Number of acceleration measurements which occurred during last frame. |
| static readonly accelerationEvents | AccelerationEvent[] | Returns list of acceleration measurements which occurred during the last frame. (Read Only) (Allocates temporary variables). |
| static readonly anyKey | bool | Is any key or mouse button currently held down? (Read Only) |
| static readonly anyKeyDown | bool | Returns true the first frame the user hits any key or mouse button. (Read Only) |
| static backButtonLeavesApp | bool | Should Back button quit the application? Only usable on Android, Windows Phone or Windows Tablets. |
| static readonly compass | Compass | Property for accessing compass (handheld devices only). (Read Only) |
| static compensateSensors | bool | This property controls if input sensors should be compensated for screen orientation. |
| static readonly compositionCursorPos | Vector2 | The current text input position used by IMEs to open windows. |
| static readonly compositionString | string | The current IME composition string being typed by the user. |
| static readonly deviceOrientation | DeviceOrientation | Device physical orientation as reported by OS. (Read Only) |
| static readonly gyro | Gyroscope | Returns default gyroscope. |
| static imeCompositionMode | IMECompositionMode | Controls enabling and disabling of IME input composition. |
| static readonly imeIsSelected | bool | Does the user have an IME keyboard input source selected? |
| static readonly inputString | string | Returns the keyboard input entered this frame. (Read Only) |
| static readonly location | LocationService | Property for accessing device location (handheld devices only). (Read Only) |
| static readonly mousePosition | Vector3 | The current mouse position in pixel coordinates. (Read Only). |
| static readonly mousePresent | bool | Indicates if a mouse device is detected. |
| static readonly mouseScrollDelta | Vector2 | The current mouse scroll delta. (Read Only) |
| static multiTouchEnabled | bool | Property indicating whether the system handles multiple touches. |
| static simulateMouseWithTouches | bool | Enables/Disables mouse simulation with touches. By default this option is enabled. |
| static readonly stylusTouchSupported | bool | Returns true when Stylus Touch is supported by a device or platform. |
| static readonly touchCount | int | Number of touches. Guaranteed not to change throughout the frame. (Read Only) |
| static readonly touches | Touch[] | Returns list of objects representing status of all touches during last frame. (Read Only) (Allocates temporary variables). |
| static readonly touchPressureSupported | bool | Bool value which let's users check if touch pressure is supported. |
| static readonly touchSupported | bool | Returns whether the device on which application is currently running supports touch input. |
Methods
| Name | Type | Summary |
|---|---|---|
| static GetAccelerationEvent | AccelerationEvent | Returns specific acceleration measurement which occurred during last frame. (Does not allocate temporary variables). |
| static GetAxis | float | Returns the value of the virtual axis identified by axisName. |
| static GetAxisRaw | float | Returns the value of the virtual axis identified by axisName with no smoothing filtering applied. |
| static GetButton | bool | Returns true while the virtual button identified by buttonName is held down. |
| static GetButtonDown | bool | Returns true during the frame the user pressed down the virtual button identified by buttonName. |
| static GetButtonUp | bool | Returns true the first frame the user releases the virtual button identified by buttonName. |
| static GetJoystickNames | string[] | Retrieves a list of input device names corresponding to the index of an Axis configured within Input Manager. |
| static GetKey | bool | Returns true while the user holds down the key identified by the key KeyCode enum parameter. |
| static GetKeyDown | bool | Returns true during the frame the user starts pressing down the key identified by the key KeyCode enum parameter. |
| static GetKeyUp | bool | Returns true during the frame the user releases the key identified by the key KeyCode enum parameter. |
| static GetMouseButton | bool | Returns whether the given mouse button is held down. |
| static GetMouseButtonDown | bool | Returns true during the frame the user pressed the given mouse button. |
| static GetMouseButtonUp | bool | Returns true during the frame the user releases the given mouse button. |
| static GetTouch | Touch | Call Input.GetTouch to obtain a Touch struct. |
| static ResetInputAxes | void | Resets all input. After ResetInputAxes all axes return to 0 and all buttons return to 0 for one frame. |