MoveEditSelection

Forms, interaction, unicode

Description

Moves the caret of the active edit according to one named navigation key

Left and right keys delegate to MoveVisualCaret, so horizontal movement follows the physical visual order of bidirectional text

Home and End move to the start or end of the current line, or of the whole value when a document boundary is requested, and Up and Down move one line while preserving the caret's grapheme column, clamped to the shorter target line

Extending the selection keeps the anchor and moves only the caret, while a plain move collapses both to the new position and discards the cached visual caret slot

Declaration

function MoveEditSelection(InputKey: TPDFlibFormInputKey;
  ExtendSelection, DocumentBoundary: Boolean): Integer;

Parameters

InputKeyNamed navigation key, one of fikLeft, fikRight, fikHome, fikEnd, fikUp or fikDown
ExtendSelectionTrue to extend the directed selection from the anchor instead of collapsing it
DocumentBoundaryTrue to make Home and End target the whole value instead of the current line

Return value

Returns 1 when the caret moved and 0 when no edit is active, the key is not a navigation key or the session is applying an edit, history step or commit

See also

MoveVisualCaret, DispatchInputEvent, SelectionCaret, NormalizeSelection, TPDFlibFormInputEvent