# GvrControllerInput Class Reference

# GvrControllerInput

Main entry point for the Daydream controller API.

## Summary

To use this API, add this script to a game object in your scene, or use the **GvrControllerMain** prefab. This is a singleton object. There can only be one object with this script in your scene.

To access a controller's state, get a device from `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a999e8351d30b3a2cb6227382a4761a96` then query it for state. For example, to the dominant controller's current orientation, use `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a999e8351d30b3a2cb6227382a4761a96(GvrControllerHand.Dominant).Orientation`.

### Inheritance

Inherits from: MonoBehaviour

| ### Public types ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1af0d76c536b7818dc18f04ad0e878f70e{ https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1af0d76c536b7818dc18f04ad0e878f70ea88559a0cfd8250c9d65970cc145c92d4, https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1af0d76c536b7818dc18f04ad0e878f70ea7aca5ec618f7317328dcd7014cf9bdcf, https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1af0d76c536b7818dc18f04ad0e878f70ea2f0b4d2c0c3d64bbb2cd525dbba8b0d0 }` | enumController Emulatuor connection modes. |

| ### Public attributes ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a6e7295b8515034a770ed0a908c369556 = EmulatorConnectionMode.USB` | `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1af0d76c536b7818dc18f04ad0e878f70e` Indicates how to connect to the controller emulator. |

| ### Events ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a72e3d4d3fe01c56fcd95ddac12191de6` | `static Action` Event handler for receiving button, touchpad, and IMU updates from the controllers. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a838a571e6b277fb110651da24cf55bd1` | `static Action` Event handler for receiving a second notification callback, after all `OnControllerInputUpdated` events have fired. |

| ### Properties ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a93c3d8e8658a579158ef3e1d771cd6d3` | `static Vector3` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1addba5cbc64de4a5858a426401fd24325`. Gets the dominant controller's current acceleration in meters per second squared. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a536b5d44a976db952b57137eb334a40a` | `static GvrControllerApiStatus` Gets the status of the controller API. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a18dd26f97ebda4876f7c100abd98ec04` | `static bool` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a211230d723885785c1a384891089faaa(GvrControllerButton.App)`. Gets a value indicating whether the user is currently holding down the dominant controller's app button. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1ac8c615e56ea4285e9e2d9f012283f7fe` | `static bool` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a8e46e0e8a233540a556f55eb64c7d8a3(GvrControllerButton.App)`. Gets a value indicating whether this is the frame the user started pressing down the dominant controller's app button. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a08eaa1d28553479d0e87fb02ca8f0adb` | `static bool` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a129710cec0f1334f08cd602505c910b6(GvrControllerButton.App)`. Gets a value indicating whether this is the frame after the user stopped pressing down the dominant controller's app button. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a430dc01ea241c13703508cba669055b3` | `static GvrControllerBatteryLevel` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a854bdcefc864c0e5759546943afacf1d`. Gets the dominant controller's current battery charge level. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1abb4d06359f90d89f4b0207beac5b446c` | `static bool` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a211230d723885785c1a384891089faaa(GvrControllerButton.TouchPadButton)`. Gets a value indicating whether the user currently holds down the dominant controller's touchpad button. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1aadda38893a66bc21d76ae51774a6d64f` | `static bool` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a8e46e0e8a233540a556f55eb64c7d8a3(GvrControllerButton.TouchPadButton)`. Gets a value indicating whether this is the frame the user starts pressing down the dominant controller's touchpad button. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1ae8a363d3e56dd7dcf908eef2fccffb29` | `static bool` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a129710cec0f1334f08cd602505c910b6(GvrControllerButton.TouchPadButton)`. Gets a value indicating whether this is the frame after the user stops pressing down the dominant controller's touchpad button. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a8b0809090046ca9ffe74ff50a2237db4` | `static string` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a0f55798b094d9b2c915e3caf625093c1`. Gets details about the reasoning behind the Dominant Controller's error state. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a2856dfcb0f335d5a8712921a570ed846` | `static Vector3` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a25a377c2a923188c6e33099d369c578d`. Gets the dominant controller's current angular speed in radians per second. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a61229bb92508eba61cf57a9980819768` | `static bool` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a8e46e0e8a233540a556f55eb64c7d8a3(GvrControllerButton.System)`. Gets a value indicating whether this is the frame the user started pressing down the dominant controller's system button. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1ac779d68c21ebd0e41d2d5b3caceca979` | `static bool` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by [GvrControllerInputDevice.GetButton](https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a211230d723885785c1a384891089faaa)(GvrControllerButton.System). Gets a value indicating whether the user is holding down the dominant controller's system button. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a4185d3214c7aff1f6fba0e5a7bf371fe` | `static bool` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1adb56a29fb51b36068a935de3caca5e2b`. Gets a value indicating whether the dominant controller is currently being charged. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a1a7fb1dd85946e99aaee70619e7ef576` | `static bool` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a211230d723885785c1a384891089faaa(GvrControllerButton.TouchPadTouch)`. Gets a value indicating whether the user is touching the dominant controller's touchpad. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a7339d6d9c8154ed8be9b75c7c617bdc5` | `static Action` Event handler for when controller devices have changed. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a35d9bc5dfaac9eb853d40cca1d1cc627` | `static https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a9de085bc0a7c592c4cd6bebc707496df` Event handler for when the connection state of the dominant controller changes. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1ae3838bb00c50c9b40a97511e22be2ce2` | `static Quaternion` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1aaa9d9e247cf16e6aed7af591a085913f`. Gets the dominant controller's current orientation in space, as a quaternion. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1aa9e83b94a8677ae002d66afccbecdde4` | `static bool` Gets a value indicating whether the user just completed the recenter gesture. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a5bd58a4d0c464b21ef132026c064c682` | `static bool` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Use `Recentered` to detect when user has completed the recenter gesture. Gets a value indicating whether the user is currently recentering. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1aae577f4b6dcf3496317b64eb9d1d4805` | `static GvrConnectionState` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1ac0dd37fe365d6b39138b3af67736de7d`. Gets the dominant controller's current connection state. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1afa253dc828d1ce897096ab2967a7d9ee` | `static IntPtr` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1ad2580c473bbb082421f993e169466744`. Gets the GVR C library controller state pointer (`gvr_controller_state*`) for the dominant controller. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1ac218198577b2fdabe90b156587674e98` | `static bool` Gets a value indicating whether battery status is supported. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a325d4dd5c6bd2359c3d72bdf593fc2c8` | `static bool` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a8e46e0e8a233540a556f55eb64c7d8a3(GvrControllerButton.TouchPadTouch)`. Gets a value indicating whether this frame is the frame the user starts touching the dominant controller's touchpad. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a8f6c27486adaf6dc443f9d8b2c04fbef` | `static Vector2` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Please migrate to the center-relative `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1aafb99a683bacb2ac694a42f5410a9018`. Gets the position of the dominant controller's current touch, if touching the touchpad. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1aad29e4802cc0f53d859cfce8fa2273d1` | `static Vector2` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Please migrate to the center-relative `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1aafb99a683bacb2ac694a42f5410a9018`. Gets the position of the dominant controller's current touch, if touching the touchpad. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a028fe50284be3c5ac474738372d76346` | `static bool` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a129710cec0f1334f08cd602505c910b6(GvrControllerButton.TouchPadTouch)`. Gets a value indicating whether this frame is the frame after the user stops touching the dominant controller's touchpad. |

| ### Public functions ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a9de085bc0a7c592c4cd6bebc707496df(GvrConnectionState state, GvrConnectionState oldState)` | `delegate void` Event handler for when the connection state of a controller changes. |

| ### Public static functions ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput_1a999e8351d30b3a2cb6227382a4761a96(GvrControllerHand hand)` | `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice` Returns a controller device for the specified hand. |

## Public types

### EmulatorConnectionMode

```c#
 EmulatorConnectionMode
```
Controller Emulatuor connection modes.

| Properties ||
|---|---|
| `OFF` | Emulator disconnected. |
| `USB` | Emulator connects over USB. |
| `WIFI` | Emulator connects over WIFI. |

## Public attributes

### emulatorConnectionMode

```c#
EmulatorConnectionMode emulatorConnectionMode = EmulatorConnectionMode.USB
```
Indicates how to connect to the controller emulator.

## Events

### OnControllerInputUpdated

```c#
static Action OnControllerInputUpdated
```
Event handler for receiving button, touchpad, and IMU updates from the controllers.

Use this handler to update app state based on controller input.

### OnPostControllerInputUpdated

```c#
static Action OnPostControllerInputUpdated
```
Event handler for receiving a second notification callback, after all `OnControllerInputUpdated` events have fired.

## Properties

### Accel

```c#
static Vector3 Accel
```
Gets the dominant controller's current acceleration in meters per second squared.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1addba5cbc64de4a5858a426401fd24325`.

The controller's axes are:

- X points to the right.
- Y points perpendicularly up from the controller's top surface.
- Z lies along the controller's body, pointing towards the front.

<br />

Note that gravity is indistinguishable from acceleration, so when the controller is resting on a surface, expect to measure an acceleration of 9.8 m/s\^2 on the Y axis. The accelerometer reading will be zero on all three axes only if the controller is in free fall, or if the user is in a zero gravity environment like a space station.

The acceleration. Will be `Vector3.zero` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized.

### ApiStatus

```c#
static GvrControllerApiStatus ApiStatus
```
Gets the status of the controller API.

Returns `GvrControllerApiStatus.Error` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized.

The api status.

### AppButton

```c#
static bool AppButton
```
Gets a value indicating whether the user is currently holding down the dominant controller's app button.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a211230d723885785c1a384891089faaa(GvrControllerButton.App)`.

Returns `false` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized.

Value `true` if the user is currently holding down the dominant controller's app button, `false` otherwise.

### AppButtonDown

```c#
static bool AppButtonDown
```
Gets a value indicating whether this is the frame the user started pressing down the dominant controller's app button.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a8e46e0e8a233540a556f55eb64c7d8a3(GvrControllerButton.App)`.

Returns `false` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized. Every `AppButtonDown` event is guaranteed to be followed by exactly one `AppButtonUp` event in a later frame. `AppButtonDown` and `AppButtonUp` will never both be `true` in the same frame.

Value `true` if this is the frame the user started pressing down the dominant controller's app button, `false` otherwise.

### AppButtonUp

```c#
static bool AppButtonUp
```
Gets a value indicating whether this is the frame after the user stopped pressing down the dominant controller's app button.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a129710cec0f1334f08cd602505c910b6(GvrControllerButton.App)`.

Returns `false` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized. Every `AppButtonUp` event is guaranteed to be preceded by exactly one `AppButtonDown` event in an earlier frame. Also, `AppButtonDown` and `AppButtonUp` will never both be `true` in the same frame.

Value `true` if this is the frame after the user stopped pressing down the dominant controller's app button, `false` otherwise.

### BatteryLevel

```c#
static GvrControllerBatteryLevel BatteryLevel
```
Gets the dominant controller's current battery charge level.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a854bdcefc864c0e5759546943afacf1d`.

Returns `GvrControllerBatteryLevel.Error` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized.

The dominant controller's current battery charge level.

### ClickButton

```c#
static bool ClickButton
```
Gets a value indicating whether the user currently holds down the dominant controller's touchpad button.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a211230d723885785c1a384891089faaa(GvrControllerButton.TouchPadButton)`.

Returns `false` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized.

Value `true` if the user currently holds down the dominant controller's touchpad button, `false` otherwise.

### ClickButtonDown

```c#
static bool ClickButtonDown
```
Gets a value indicating whether this is the frame the user starts pressing down the dominant controller's touchpad button.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a8e46e0e8a233540a556f55eb64c7d8a3(GvrControllerButton.TouchPadButton)`.

Returns `false` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized. Every `ClickButtonDown` event is guaranteed to be followed by exactly one `ClickButtonUp` event in a later frame. Also, `ClickButtonDown` and `ClickButtonUp` will never both be `true` in the same frame.

Value `true` this is the frame the user started pressing down the dominant controller's touchpad button, `false` otherwise.

### ClickButtonUp

```c#
static bool ClickButtonUp
```
Gets a value indicating whether this is the frame after the user stops pressing down the dominant controller's touchpad button.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a129710cec0f1334f08cd602505c910b6(GvrControllerButton.TouchPadButton)`.

Returns `false` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized. Every `ClickButtonUp` event is guaranteed to be preceded by exactly one `ClickButtonDown` event in an earlier frame. Also, `ClickButtonDown` and `ClickButtonUp` will never both be `true` in the same frame.

Value `true` if this is the frame after the user stops pressing down the dominant controller's touchpad button, `false` otherwise.

### ErrorDetails

```c#
static string ErrorDetails
```
Gets details about the reasoning behind the Dominant Controller's error state.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a0f55798b094d9b2c915e3caf625093c1`.

If the dominant controller's state `== GvrConnectionState.Error`, this contains details about the error. If `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized this returns an error string describing the uninitialized state.

Details about the reasoning behind the dominant controller's error state.

### Gyro

```c#
static Vector3 Gyro
```
Gets the dominant controller's current angular speed in radians per second.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a25a377c2a923188c6e33099d369c578d`.

Uses the right-hand rule (positive means a right-hand rotation about the given axis), as measured by the controller's gyroscope. Returns `Vector3.zero` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized.

The controller's axes are:

- X points to the right.
- Y points perpendicularly up from the controller's top surface.
- Z lies along the controller's body, pointing towards the front.

<br />

The gyro's angular speed.

### HomeButtonDown

```c#
static bool HomeButtonDown
```
Gets a value indicating whether this is the frame the user started pressing down the dominant controller's system button.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a8e46e0e8a233540a556f55eb64c7d8a3(GvrControllerButton.System)`.

Returns `false` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized.

Value `true` if this is the frame the user started pressing down the dominant controller's system button, `false` otherwise.

### HomeButtonState

```c#
static bool HomeButtonState
```
Gets a value indicating whether the user is holding down the dominant controller's system button.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by [GvrControllerInputDevice.GetButton](https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a211230d723885785c1a384891089faaa)(GvrControllerButton.System).

Returns `false` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized.

Value `true` if the user is holding down the dominant controller's system button, `false` otherwise.

### IsCharging

```c#
static bool IsCharging
```
Gets a value indicating whether the dominant controller is currently being charged.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1adb56a29fb51b36068a935de3caca5e2b`.

Returns `false` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized.

Value `true` if the dominant controller is charging. Otherwise, `false`.

### IsTouching

```c#
static bool IsTouching
```
Gets a value indicating whether the user is touching the dominant controller's touchpad.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a211230d723885785c1a384891089faaa(GvrControllerButton.TouchPadTouch)`.

Returns `false` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized.

Value `true` if is touching. Otherwise, `false`.

### OnDevicesChanged

```c#
static Action OnDevicesChanged
```
Event handler for when controller devices have changed.

Any code that stores a `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice` should get a new device instance from `GetDevice`. Existing `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice`s will be marked invalid and will log errors when used. Event handlers are called immediately when added.

### OnStateChanged

```c#
static OnStateChangedEvent OnStateChanged
```
Event handler for when the connection state of the dominant controller changes.

### Orientation

```c#
static Quaternion Orientation
```
Gets the dominant controller's current orientation in space, as a quaternion.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1aaa9d9e247cf16e6aed7af591a085913f`.

The rotation is provided in 'orientation space' which means the rotation is given relative to the last time the user recentered their controllers. To make a game object in your scene have the same orientation as the dominant controller, simply assign this quaternion to the object's `transform.rotation`. To match the relative rotation, use `transform.localRotation` instead.

The orientation. This is `Quaternion.identity` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized.

### Recentered

```c#
static bool Recentered
```
Gets a value indicating whether the user just completed the recenter gesture.

Returns `false` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized. The headset and the dominant controller's orientation are now being reported in the new recentered coordinate system. This is an event flag (it is true for only one frame after the event happens, then reverts to false).

Value `true` if the user has just finished recentering, `false` otherwise.

### Recentering

```c#
static bool Recentering
```
Gets a value indicating whether the user is currently recentering.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Use `Recentered` to detect when user has completed the recenter gesture.

Value `true` if the user is currently recentering, `false` otherwise.

### State

```c#
static GvrConnectionState State
```
Gets the dominant controller's current connection state.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1ac0dd37fe365d6b39138b3af67736de7d`.

Returns `GvrConnectionState.Error` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized.

The state.

### StatePtr

```c#
static IntPtr StatePtr
```
Gets the GVR C library controller state pointer (`gvr_controller_state*`) for the dominant controller.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1ad2580c473bbb082421f993e169466744`.

Returns `IntPtr.Zero` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized.

The GVR C library controller state pointer (`gvr_controller_state*`) for the dominant controller.

### SupportsBatteryStatus

```c#
static bool SupportsBatteryStatus
```
Gets a value indicating whether battery status is supported.

Returns `false` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized.

Value `true` if the GVR Controller Input supports BatteryStatus calls, `false` otherwise.

### TouchDown

```c#
static bool TouchDown
```
Gets a value indicating whether this frame is the frame the user starts touching the dominant controller's touchpad.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a8e46e0e8a233540a556f55eb64c7d8a3(GvrControllerButton.TouchPadTouch)`.

Returns `false` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized. Every `TouchDown` event is guaranteed to be followed by exactly one `TouchUp` event in a later frame. Also, `TouchDown` and `TouchUp` will never both be `true` in the same frame.

Value `true` if this is the frame after the user starts touching the dominant controller's touchpad, `false` otherwise.

### TouchPos

```c#
static Vector2 TouchPos
```
Gets the position of the dominant controller's current touch, if touching the touchpad.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Please migrate to the center-relative `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1aafb99a683bacb2ac694a42f5410a9018`.

Returns `Vector2(0.5f, 0.5f)` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized. If not touching, this is the position of the last touch (when the finger left the touchpad). The X and Y range is from 0 to 1. (0, 0) is the top left of the touchpad and (1, 1) is the bottom right of the touchpad.

The touch position.

### TouchPosCentered

```c#
static Vector2 TouchPosCentered
```
Gets the position of the dominant controller's current touch, if touching the touchpad.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Please migrate to the center-relative `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1aafb99a683bacb2ac694a42f5410a9018`.

Returns `Vector2.zero` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized. If not touching, this is the position of the last touch (when the finger left the touchpad). The X and Y range is from -1 to 1. (-.707,-.707) is bottom left, (.707,.707) is upper right. (0, 0) is the center of the touchpad. The magnitude of the touch vector is guaranteed to be less than or equal to 1.

The touch position centered.

### TouchUp

```c#
static bool TouchUp
```
Gets a value indicating whether this frame is the frame after the user stops touching the dominant controller's touchpad.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice_1a129710cec0f1334f08cd602505c910b6(GvrControllerButton.TouchPadTouch)`.

Returns `false` if `https://developers.google.com/vr/reference/unity/class/GvrControllerInput#classGvrControllerInput` is uninitialized. Every `TouchUp` event is guaranteed to be preceded by exactly one `TouchDown` event in an earlier frame. Also, `TouchDown` and `TouchUp` will never both be `true` in the same frame.

Value `true` if this is the frame after the user stops touching the dominant controller's touchpad, `false` otherwise.

## Public functions

### OnStateChangedEvent

```c#
delegate void OnStateChangedEvent(
  GvrConnectionState state,
  GvrConnectionState oldState
)
```
Event handler for when the connection state of a controller changes.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `state` | The new state. | | `oldState` | The previous state. | |

## Public static functions

### GetDevice

```c#
GvrControllerInputDevice GetDevice(
  GvrControllerHand hand
)
```
Returns a controller device for the specified hand.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `hand` | The hand whose input device should be fetched. | |
| **Returns** | The controller input device. |