# ITextSelection

> Interface to access a TextElement selection and cursor information This interface is not meant to be implemented explicitly as its declaration might change in the future.

## Definition

* **Type:** Interface
* **Namespace:** [UnityEngine.UIElements](/engine/6000.0/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

```csharp
public interface ITextSelection
```

## Properties

| Property                                                                                                                  | Description                                                                              |
| ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| [cursorIndex](/engine/6000.0/script-reference/unityengine/uielements/itextselection/cursorindex.md)                       | This is the cursor index in the text presented.                                          |
| [cursorPosition](/engine/6000.0/script-reference/unityengine/uielements/itextselection/cursorposition.md)                 | The position of the text cursor inside the element.                                      |
| [doubleClickSelectsWord](/engine/6000.0/script-reference/unityengine/uielements/itextselection/doubleclickselectsword.md) | Controls whether double-clicking selects the word under the mouse pointer.               |
| [isSelectable](/engine/6000.0/script-reference/unityengine/uielements/itextselection/isselectable.md)                     | Returns true if the field is selectable.                                                 |
| [selectAllOnFocus](/engine/6000.0/script-reference/unityengine/uielements/itextselection/selectallonfocus.md)             | Controls whether the element's content is selected upon receiving focus.                 |
| [selectAllOnMouseUp](/engine/6000.0/script-reference/unityengine/uielements/itextselection/selectallonmouseup.md)         | Controls whether the element's content is selected when you mouse up for the first time. |
| [selectIndex](/engine/6000.0/script-reference/unityengine/uielements/itextselection/selectindex.md)                       | This is the selection index in the text presented.                                       |
| [tripleClickSelectsLine](/engine/6000.0/script-reference/unityengine/uielements/itextselection/tripleclickselectsline.md) | Controls whether triple-clicking selects the entire line under the mouse pointer.        |

## Methods

| Method                                                                                                | Description                                      |
| ----------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| [HasSelection](/engine/6000.0/script-reference/unityengine/uielements/itextselection/hasselection.md) | Return true is the TextElement has a selection.  |
| [SelectAll](/engine/6000.0/script-reference/unityengine/uielements/itextselection/selectall.md)       | Selects all the text contained in the field.     |
| [SelectNone](/engine/6000.0/script-reference/unityengine/uielements/itextselection/selectnone.md)     | Remove selection                                 |
| [SelectRange](/engine/6000.0/script-reference/unityengine/uielements/itextselection/selectrange.md)   | Select text between cursorIndex and selectIndex. |
