Skip to main content

ICursorHandler

Interfaces

ICursorHandler

Handler for performing simple operations with the cursor.

Properties

cursorChangeEvent
cursorChangeEvent: EventObject<IPositionInText>;

Cursor change event.

Remarks

Reports the current cursor position.

Methods

getCurrentParagraphIndex()
getCurrentParagraphIndex(): number;

Returns the current index of the paragraph.

Returns

number

getCurrentPosition()
getCurrentPosition(): IPositionInText;

Returns the current cursor position.

Returns

IPositionInText

getCurrentWord()
getCurrentWord(): ITextRange;

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

Returns

ITextRange

Remarks

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

getFirstPosition()
getFirstPosition(): IPositionInText;

Returns the first position in the text.

Returns

IPositionInText

getPositionByPoint()
getPositionByPoint(point): IPositionInText;

Returns the position in the text by point.

Parameters
ParameterTypeDescription
pointIPointpoint coordinates
Returns

IPositionInText

Remarks

the cursor does not move.

moveToDirection()
moveToDirection(direction): boolean;

Moves the current cursor position in the specified direction.

Parameters
ParameterTypeDescription
directionMoveDirectionTypedirection of cursor movement.
Returns

boolean

setToPoint()
setToPoint(point): void;

Sets the cursor to a point in the text.

Parameters
ParameterTypeDescription
pointIPointthe expected point.
Returns

void

setToPosition()
setToPosition(position): void;

Sets the cursor at a position in the text.

Parameters
ParameterTypeDescription
positionIPositionInTextthe expected position in the text.
Returns

void

Was this page helpful?