Name
playout:GetCursorPos -- get cursor pos
Synopsis
strong_pos, weak_pos = playout:GetCursorPos(index)
Function
Given an index within a layout, determines the positions that of the strong and weak cursors if the insertion point is at that index. Both strongpos and weakpos will be tables that have the fields x, y, width, and height initialized. The position of each cursor is stored as a zero-width rectangle with the height of the run extents.

The strong cursor location is the location where characters of the directionality equal to the base direction of the layout are inserted. The weak cursor location is the location where characters of the directionality opposite to the base direction of the layout are inserted.

The following example shows text with both a strong and a weak cursor.

The strong cursor has a little arrow pointing to the right, the weak cursor to the left. Typing a 'c' in this situation will insert the character after the 'b', and typing another Hebrew character, like 'ג', will insert it at the end.

Inputs
index
the byte index of the cursor
Results
strong_pos
strong cursor position
weak_pos
weak cursor position

Show TOC