Moving Caret and Text Selection

In a text editor, caret indicates the place where text is to be inserted. Over the years, we have been trained to to move caret around accurately with mouse. On touch screen, our finger becomes the pointing device. It is quick but also inaccurate, and the pointing finger always covers the text underneath, making it hard to see where the caret is.

On iOS the default solution as we all know is to use a magnifier. The caret is shown in a magnifying glass while your finger moves over the text. Android simply adds a pad under the caret, and you move the caret by holding on the pad.

In TEX Writer, We are going to introduce a unique solution. Instead of keeping the text static, we realize that when you press on the text, the text under your finger should automatically move away to avoid being covered by finger tip. In technical words, the pressed line will be splitted, leaving room for the pointing finger. In this way, no text will be covered; eyes are exactly where your finger is; no need to hold on a tiny pad. See Figure 1.

Figure 1. Moving Caret

As you see, when you press on the screen for about half a second, the vertical caret turns into a horizontal bar and pushes the text to either left or right. When your finger moves to left, characters on the left side will slip to the right one by one. Similarly, when your finger moves right, characters on the right will slip to left. When you lift the finger, the place under your finger tip becomes the inserting point, the horizontal bar turns back into a blinking vertical caret, and you can start typing again.

Sometimes we want to move the caret around in the neighborhood, pressing on the text is just too much. In this case, we provide two arrow keys on the accessory keyboard. They can be used to move caret to left or right by exactly one character. It's easier to reach, fast and accurate.

Figure 2. Accessory Keyboard with Two Arrow Keys

Now let's try selecting text with two fingers. It is very useful for selecting a paragraph very quickly. Put two fingers on the screen at anytime, and the selected text will be highlighted immediately. It is fast, no waiting at all. And you can even adjust text selection without lifting your fingers at all.

Figure 3. Selecting Text with Two Fingers

In order to select very short or very long text, we can use a two-stage selection with one finger only. You move the caret to where you want, release it, a menu shows up, tap on select, and then scroll to where the selection should end. Long press on that position and adjust the selection as you would do in moving the caret. In this way you can easily select text across more than one screen.

Figure 4. Two-Stage Text Selection

Whenever you have a selection (text shown with highlighted background), just press your finger down again, you can adjust it right away. If you want to make a selection go away, a single tap will cancel current selection and place the caret closest to where you tap.

This is all you should know about moving caret and text selection in TEX Writer.

© 2012-2017, Chaoji Li. All rights reserved.