# GvrKeyboard Class Reference

# GvrKeyboard

Handles keyboard state management such as hiding and displaying the keyboard, directly modifying text and stereoscopic rendering.

## Summary

### Inheritance

Inherits from: MonoBehaviour

| ### Public attributes ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrKeyboard#classGvrKeyboard_1a23e75442e48bc9fe9a29adc1f45e6099 = 0` | `float` The distance to the keyboard. |
| `https://developers.google.com/vr/reference/unity/class/GvrKeyboard#classGvrKeyboard_1a4f2aadc7a29a08dc4d7de81a628bdd89 = GvrKeyboardInputMode.DEFAULT` | `GvrKeyboardInputMode` The input mode of the keyboard. |
| `https://developers.google.com/vr/reference/unity/class/GvrKeyboard#classGvrKeyboard_1a7d2a961df6a2b08f30756740328722e1 = null` | `https://developers.google.com/vr/reference/unity/class/GvrKeyboardDelegateBase#classGvrKeyboardDelegateBase` Delegate to handle keyboard events and input. |
| `https://developers.google.com/vr/reference/unity/class/GvrKeyboard#classGvrKeyboard_1a8be290a79138fb2e43661e6d75a342c9 = true` | `bool` Flag to use the recommended world matrix for the keyboard. |

| ### Properties ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrKeyboard#classGvrKeyboard_1a01ec8badc1644173c443bdd62f798525` | `string` Gets or sets the text being affected by this keyboard. |
| `https://developers.google.com/vr/reference/unity/class/GvrKeyboard#classGvrKeyboard_1a4a4f8d90a5f76cd9e055936b0b3438f5` | `bool` Gets a value indicating whether this keyboard is ready. |
| `https://developers.google.com/vr/reference/unity/class/GvrKeyboard#classGvrKeyboard_1acdd4c54ac64c1238741710bcafd22481` | `bool` Gets a value indicating whether this keyboard instance is valid. |
| `https://developers.google.com/vr/reference/unity/class/GvrKeyboard#classGvrKeyboard_1ae29613bed226e5824eb5aa5ba6a0b30b` | `GvrKeyboardInputMode` Gets the current input mode of the keyboard. |
| `https://developers.google.com/vr/reference/unity/class/GvrKeyboard#classGvrKeyboard_1a0d299e8e36f023682b2a6c8835811b09` | `Matrix4x4` Gets the world matrix of the keyboard. |

| ### Public functions ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrKeyboard#classGvrKeyboard_1a8e12817cebe03db6b4669b4a02dcfc38()` | `void` Resets keyboard text. |
| `https://developers.google.com/vr/reference/unity/class/GvrKeyboard#classGvrKeyboard_1a8507757f98d7618514174215e3f9dd71(string edit_text)` | `delegate void` Edit text keyboard delegate type. |
| `https://developers.google.com/vr/reference/unity/class/GvrKeyboard#classGvrKeyboard_1a0d71aa6dce0a4cbf3ceeafd220bbb79a(GvrKeyboardError err)` | `delegate void` Keyboard error delegate type. |
| `https://developers.google.com/vr/reference/unity/class/GvrKeyboard#classGvrKeyboard_1a658187bd19febc42964c6105cb2fd10c()` | `void` Hides the keyboard. |
| `https://developers.google.com/vr/reference/unity/class/GvrKeyboard#classGvrKeyboard_1a5b101126188ea00898984ee76888af37(IntPtr closure, GvrKeyboardEvent evt)` | `delegate void` Keyboard delegate type. |
| `https://developers.google.com/vr/reference/unity/class/GvrKeyboard#classGvrKeyboard_1a73dd306e22a84d0320f7dac1eeefbce2(BaseEventData data)` | `void` Handle a pointer click on the keyboard. |
| `https://developers.google.com/vr/reference/unity/class/GvrKeyboard#classGvrKeyboard_1a8de86dd8ad22c29bcf2f9996e2c41448()` | `void` Shows the keyboard. |
| `https://developers.google.com/vr/reference/unity/class/GvrKeyboard#classGvrKeyboard_1a8bf5d1a8ed6d21b16c1567cb88c9b52d()` | `delegate void` Standard keyboard delegate type. |

## Public attributes

### distance

```c#
float distance = 0
```
The distance to the keyboard.

### inputMode

```c#
GvrKeyboardInputMode inputMode = GvrKeyboardInputMode.DEFAULT
```
The input mode of the keyboard.

### keyboardDelegate

```c#
GvrKeyboardDelegateBase keyboardDelegate = null
```
Delegate to handle keyboard events and input.

### useRecommended

```c#
bool useRecommended = true
```
Flag to use the recommended world matrix for the keyboard.

## Properties

### EditorText

```c#
string EditorText
```
Gets or sets the text being affected by this keyboard.

The text being affected by this keyboard.

### IsReady

```c#
bool IsReady
```
Gets a value indicating whether this keyboard is ready.

Value `true` if this keyboard is ready, `false` otherwise.

### IsValid

```c#
bool IsValid
```
Gets a value indicating whether this keyboard instance is valid.

Value `true` if this keyboard instance is valid, `false` otherwise.

### Mode

```c#
GvrKeyboardInputMode Mode
```
Gets the current input mode of the keyboard.

The current input mode of the keyboard.

### WorldMatrix

```c#
Matrix4x4 WorldMatrix
```
Gets the world matrix of the keyboard.

The world matrix of the keyboard.

## Public functions

### ClearText

```c#
void ClearText()
```
Resets keyboard text.

### EditTextCallback

```c#
delegate void EditTextCallback(
  string edit_text
)
```
Edit text keyboard delegate type.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `edit_text` | The edited text which has been typed into the keyboard. | |

### ErrorCallback

```c#
delegate void ErrorCallback(
  GvrKeyboardError err
)
```
Keyboard error delegate type.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `err` | The error which raised this callback. | |

### Hide

```c#
void Hide()
```
Hides the keyboard.

### KeyboardCallback

```c#
delegate void KeyboardCallback(
  IntPtr closure,
  GvrKeyboardEvent evt
)
```
Keyboard delegate type.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `closure` | A closure around the method to call. | | `evt` | The event which prompted this callback. | |

### OnPointerClick

```c#
void OnPointerClick(
  BaseEventData data
)
```
Handle a pointer click on the keyboard.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `data` | The event data associated with this callback. | |

### Show

```c#
void Show()
```
Shows the keyboard.

### StandardCallback

```c#
delegate void StandardCallback()
```
Standard keyboard delegate type.