# GvrPointerScrollInput Class Reference

# GvrPointerScrollInput

This class is used by `https://developers.google.com/vr/reference/unity/class/GvrPointerInputModule#classGvrPointerInputModule` to route scroll events through Unity's event system.

## Summary

It maintains indepedent velocities for each instance of `IScrollHandler` that is currently being scrolled. Inertia can optionally be toggled off.

| ### Public attributes ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrPointerScrollInput#classGvrPointerScrollInput_1a7b0e91b534e89e1fef03d9f517e2b0da = "decelerationRate"` | `const string` Property name for accessing deceleration rate. |
| `https://developers.google.com/vr/reference/unity/class/GvrPointerScrollInput#classGvrPointerScrollInput_1aa71cf453b2443d1a4be3c9ad4032d48c = "inertia"` | `const string` Property name for accessing inertia. |
| `https://developers.google.com/vr/reference/unity/class/GvrPointerScrollInput#classGvrPointerScrollInput_1addbf17c6af3fbf61b35aa4b50f4c5929 = 1000.0f` | `const float` Multiplier for calculating the scroll delta. |
| `https://developers.google.com/vr/reference/unity/class/GvrPointerScrollInput#classGvrPointerScrollInput_1a1c8f06c1d9c4fb615d4efa84ed6b0f24 = 0.05f` | `float` The deceleration rate is the speed reduction per second. |
| `https://developers.google.com/vr/reference/unity/class/GvrPointerScrollInput#classGvrPointerScrollInput_1a4ef95526dcdbcfe59115dd0b19159c05 = true` | `bool` Inertia means that scroll events will continue for a while after the user stops touching the touchpad. |

| ### Public functions ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrPointerScrollInput#classGvrPointerScrollInput_1a961579640d37a528ddd765f7b83425b6(GameObject currentGameObject, PointerEventData pointerData, https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer pointer, https://developers.google.com/vr/reference/unity/interface/IGvrEventExecutor#interfaceIGvrEventExecutor eventExecutor)` | `void` Performs scrolling if the user is touching the controller's touchpad. |

## Public attributes

### PROPERTY_NAME_DECELERATION_RATE

```c#
const string PROPERTY_NAME_DECELERATION_RATE = "decelerationRate"
```
Property name for accessing deceleration rate.

### PROPERTY_NAME_INERTIA

```c#
const string PROPERTY_NAME_INERTIA = "inertia"
```
Property name for accessing inertia.

### SCROLL_DELTA_MULTIPLIER

```c#
const float SCROLL_DELTA_MULTIPLIER = 1000.0f
```
Multiplier for calculating the scroll delta.

Used so that the scroll delta is within the order of magnitude that the UI system expects.

### decelerationRate

```c#
float decelerationRate = 0.05f
```
The deceleration rate is the speed reduction per second.

A value of 0.5 halves the speed each second. The default is 0.05. The deceleration rate is only used when `inertia` is `true`.

### inertia

```c#
bool inertia = true
```
Inertia means that scroll events will continue for a while after the user stops touching the touchpad.

It gradually slows down according to the `decelerationRate`.

## Public functions

### HandleScroll

```c#
void HandleScroll(
  GameObject currentGameObject,
  PointerEventData pointerData,
  GvrBasePointer pointer,
  IGvrEventExecutor eventExecutor
)
```
Performs scrolling if the user is touching the controller's touchpad.

Scroll speed is dependent upon touch position.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `currentGameObject` | The game object having the `IScrollHandler` component. | | `pointerData` | The pointer event data. | | `pointer` | The pointer object. | | `eventExecutor` | The executor to use to process the event. | |