Handling cursor key navigation

TTextLineLayout provides functions that you can use to map cursor key movements into the correct TInsertionOffset. These functions map the movement correctly based on the directionality of the current text, and properly handle navigation through bidirectional text.

To map from the current insertion point to the next, use either GetNextInsertionPoint or GetPreviousInsertionPoint. For Latin-based languages, the next insertion point is the next point to the right, and the previous insertion point is the next point to the left.

If the current text selection is a range of text, use GetRightInsertionPoint and GetLeftInsertionPoint to handle cursor key events. These functions take the currently selected text range and return the new TInsertionOffset.

TTextLineLayout also provides functions that you should use when a cursor key needs to move to the beginning or end of a line. These special functions are provided because the visually rightmost or leftmost character is not always the first or last character on the line. To retrieve the insertion point at the beginning or end of the line, use the functions GetLeftmostInsertionPoint and GetRightmostInsertionPoint.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker