# TouchScreenKeyboard

> Interface for on-screen keyboards. Only native iPhone, Android, and Windows Store Apps are supported.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public class TouchScreenKeyboard
```

## Remarks

This interface allows to display different types of the keyboard: ASCII, Numbers, URL, Email, and others.

Because the appearance of the keyboard has the potential to obscure portions of your user interface, it is up to you to make sure that parts of your user interface are not obscured when the keyboard is being displayed.

`TouchScreenKeyboard.visible` and `TouchScreenKeyboard.area` should be used to determine if the keyboard is being shown (activated) and what portion of the screen is using.

**Universal Windows Platform**: On Universal Windows Apps the touch screen keyboard is supported when physical keyboard is not connected.

**Note**: Attempting to access any properties of this class on an unsupported platform throws an exception. If you're targeting multiple platforms, make sure your code checks [TouchScreenKeyboard.isSupported](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/issupported.md) before attempting to use it.

## Properties

| Property                                                                                              | Description                                                                                                                                                                                |
| ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [active](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/active.md)                   | Is the keyboard visible or sliding into the position on the screen?                                                                                                                        |
| [canGetSelection](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/cangetselection.md) | Specifies whether the TouchScreenKeyboard supports the [TouchScreenKeyboard.selection](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/selection.md) property. (Read Only) |
| [canSetSelection](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/cansetselection.md) | Specifies whether the TouchScreenKeyboard supports the [TouchScreenKeyboard.selection](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/selection.md) property. (Read Only) |
| [characterLimit](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/characterlimit.md)   | How many characters the keyboard input field is limited to. 0 = infinite.                                                                                                                  |
| [selection](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/selection.md)             | Gets or sets the character range of the selected text within the string currently being edited.                                                                                            |
| [status](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/status-1.md)                 | Returns the status of the on-screen keyboard. (Read Only)                                                                                                                                  |
| [targetDisplay](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/targetdisplay.md)     | Specifies on which display the on-screen keyboard will appear.                                                                                                                             |
| [text](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/text.md)                       | Returns the text displayed by the input field of the keyboard.                                                                                                                             |
| [type](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/type.md)                       | Returns the [TouchScreenKeyboardType](/engine/6000.0/script-reference/unityengine/touchscreenkeyboardtype.md) of the keyboard.                                                             |

## Static Properties

| Property                                                                                                              | Description                                                                                                                                                                    |
| --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [area](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/area.md)                                       | Indicates the portion of the screen that is currently covered by the on-screen keyboard.                                                                                       |
| [hideInput](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/hideinput.md)                             | Will text input field above the keyboard be hidden when the keyboard is on screen?                                                                                             |
| [inputFieldAppearance](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/inputfieldappearance-1.md)     | Returns the current visibility status of the on-screen keyboard's input field. (Read Only)                                                                                     |
| [isInPlaceEditingAllowed](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/isinplaceeditingallowed.md) | Checks if the text within an input field can be selected and modified while [TouchScreenKeyboard](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard.md) is open. |
| [isSupported](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/issupported.md)                         | Checks if on-screen keyboards are supported.                                                                                                                                   |
| [visible](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/visible.md)                                 | Returns true whenever any keyboard is visible on the screen.                                                                                                                   |

## Static Methods

| Method                                                                          | Description                                             |
| ------------------------------------------------------------------------------- | ------------------------------------------------------- |
| [Open](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/open.md) | Opens the native keyboard provided by OS on the screen. |

## Classes

| Class                                                                                                     | Description                                   |
| --------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| [TouchScreenKeyboard.Android](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/android.md) | Android specific on-screen keyboard settings. |

## Enums

| Enum                                                                                                                                | Description                                                                      |
| ----------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| [TouchScreenKeyboard.InputFieldAppearance](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/inputfieldappearance.md) | Options to define the visibility status of the on-screen keyboard's input field. |
| [TouchScreenKeyboard.Status](/engine/6000.0/script-reference/unityengine/touchscreenkeyboard/status.md)                             | The status of the on-screen keyboard.                                            |
