---
title: "ICursorHandler | Customer's Canvas On-Premises"
canonical: "https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICursorHandler/"
---

# ICursorHandler

> Handler for performing simple operations with the cursor.

## Interfaces

### ICursorHandler

#### Properties

##### cursorChangeEvent

```ts
cursorChangeEvent: EventObject<IPositionInText>;
```

Cursor change event.

###### Remarks

Reports the current cursor position.

#### Methods

##### getCurrentParagraphIndex()

```ts
getCurrentParagraphIndex(): number;
```

Returns the current index of the paragraph.

###### Returns

`number`

##### getCurrentPosition()

```ts
getCurrentPosition(): IPositionInText;
```

Returns the current cursor position.

###### Returns

[`IPositionInText`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IPositionInText.md#ipositionintext)

##### getCurrentWord()

```ts
getCurrentWord(): ITextRange;
```

Returns the text range of the word the cursor is on.

###### Returns

[`ITextRange`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ITextRange.md#itextrange)

###### Remarks

not only the current word is selected, but also the gap to the next word.

##### getFirstPosition()

```ts
getFirstPosition(): IPositionInText;
```

Returns the first position in the text.

###### Returns

[`IPositionInText`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IPositionInText.md#ipositionintext)

##### getPositionByPoint()

```ts
getPositionByPoint(point): IPositionInText;
```

Returns the position in the text by point.

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `point` | [IPoint](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/IPoint.md) | point coordinates |

###### Returns

[`IPositionInText`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IPositionInText.md#ipositionintext)

###### Remarks

the cursor does not move.

##### moveToDirection()

```ts
moveToDirection(direction): boolean;
```

Moves the current cursor position in the specified direction.

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `direction` | [`MoveDirectionType`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/MoveDirectionType.md#movedirectiontype) | direction of cursor movement. |

###### Returns

`boolean`

##### setToPoint()

```ts
setToPoint(point): void;
```

Sets the cursor to a point in the text.

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `point` | [IPoint](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/IPoint.md) | the expected point. |

###### Returns

`void`

##### setToPosition()

```ts
setToPosition(position): void;
```

Sets the cursor at a position in the text.

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `position` | [`IPositionInText`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IPositionInText.md#ipositionintext) | the expected position in the text. |

###### Returns

`void`
