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

# ICursorService

> Service for performing basic operations with the cursor.

## Interfaces

### ICursorService

#### Extended by

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

#### Properties

##### cursorChangedEvent

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

Cursor change event.

###### Remarks

Reports the current cursor position.

#### Methods

##### getCurrentParagraphIndex()

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

Returns the current index of the paragraph (from 0).

###### 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)

##### 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)

##### moveCursorToDirection()

```ts
moveCursorToDirection(direction, withSelection?): void;
```

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. |
| `withSelection?` | `boolean` | indicates whether the cursor moves with text selection (the default value is false). |

###### Returns

`void`

##### setCursorToPoint()

```ts
setCursorToPoint(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`

##### setCursorToPosition()

```ts
setCursorToPosition(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`
