In computing, caret navigation is a kind of keyboard navigation where a caret (also known as "text cursor", "text insertion cursor", or "text selection cursor") is used to navigate within a text document. It is a fundamental feature for applications that deal with text, for example text editors (famous examples include: Notepad, Emacs and Vim), word processors (famous examples include: Microsoft Word, WordPerfect and WordStar), desktop publishing programs (e.g.PageMaker, Microsoft Publisher), and spreadsheets (Excel, Lotus 123).
This kind of navigation is also supported by some web browsers, such as Mozilla Firefox and Internet Explorer, where it is referred to as "caret browsing". This can be contrasted with the alternate and more usual control methods of using a mouse to point to links and select text for copying or editing, or using tabs to step through and highlight each link on the page in turn. It is however not a universally supported control method; notably, Google Chrome does not (as of November 2012) offer it as a built-in function.
In this text navigation mode, the "cursor" (often depicted as a blinking vertical line) appears within the text on-screen. The user can then navigate throughout the text by using the arrow navigation keys to cause the cursor to move; typically changing the cursor's location in increments of character position horizontally and of text line vertically.
Once the cursor has been positioned as desired, any text typed will appear at the location of the cursor, either inserting the text and pushing any subsequent text further downwards, or overwriting any existing text (a mode of operation typically toggled by the Insert Key on most computer keyboards/systems).
The user can also perform various actions to manipulate the text, including such operations as:
- selecting a block of text to e.g. change size/font or copy to the clipboard, by holding shift and pressing the arrow cursor or other navigation keys, which commonly extends a coloured or inverse-video highlight over the selected area
- inserting/deleting text and control characters at/from an arbitrary point, including cut and paste functions
- activating internet hyperlinks by pressing the Enter key whilst the caret is placed within them
Caret navigation usually also incorporates a form of viewport scrolling control, where the caret moves freely within certain margins of a static display, but triggers a scrolling event upon reaching one of the margins (either the edge of the screen/window/text field, or a point a certain number of lines/characters within said edge).
For example, the view within a WYSIWYG word processor may scroll the whole viewport a certain amount down the page as the caret nears the lower edge of the edit window, in order to keep the text currently being entered or edited roughly centered without excessive, distracting and potentially computationally expensive line-by-line scrolling.
Similarly, a spreadsheet character-based word processor on a low-resolution screen may scroll in all directions, character-by-character or line-by-line, maintaining a small margin which the caret never enters in order to show the user what text or cells lie directly "ahead" of or "behind" the edit point and prevent them from "working blind".
In contrast, a plain text text entry form may use a simpler method, setting a fixed and arbitrary display width within which the caret always "wraps around", only scrolling up or down a line as the caret reaches the wrap point at the start/end of the current first/last line, in order to keep the edit point in view as it moves to the previous/next line of text; all other scrolling must be manually controlled by the user, by use of scroll bars, mouse wheel, or Page Up/Page Down keys. Another alternate form of control is used in some spreadsheets when the Scroll Lock key is activated; in this case the caret is locked to the centre of the screen, and the cursor keys instead move the worksheet itself "underneath" the static caret, instead of the caret moving "over" the sheet. Effectively, the margins that trigger a scrolling action are increased to their maximum possible size (vs the minimum possible with the web edit box), causing the caret to be recentred any time it attempts to move.