Left/right arrow semantics must be remapped to text direction rather than assumed fixed
Aliases: arrows and bidi · left key logical previous · visual movement
What it is
The left arrow in a Latin editor usually means “logically backward (smaller index)” and also moves left on screen. In RTL or mixed text those two facts cannot stay glued. Some products make left always walk toward the screen's left (visual movement); others always decrement the logical index (logical movement). Semantics must be remapped to text direction and kept consistent inside one product. Assuming “left means index minus one” in an Arabic paragraph jumps the caret from the visually previous glyph to the visually next one.
Why it happens
Logical movement: left decrements the index in LTR and still decrements in RTL, so the caret walks right on screen—which for RTL users is “back to the letter just written.” Visual movement: left always goes screen-left, so the logical index increases inside an RTL run. In mixed text, visual movement leaps logically far at a run boundary; logical movement leaps on the screen. OS text fields, contenteditable, and custom canvases each pick a set, so users meet opposite arrows in different controls of one document. A homemade widget that never remaps has the Latin assumption hard-coded.
Studying it
In LTR, RTL, and mixed paragraphs, record logical index and screen x after each left/right press. Ask native users whether they expect visual or logical movement. Check that the product's custom editor matches the system field. Do not test English only. Word-jump shortcuts (Ctrl+Left) must define word edges by writing direction too.
Where it stops holding
Arrows in games and maps mean screen direction and should not follow text. Spreadsheet cell navigation is a grid, not a text run. In vertical type, “left” may mean the previous line; swap in up/down. Screen-reader users hear logical offsets; visual movement splits their caret from sighted users'.
Applying it
- Pick one convention for the text editor (recommended: logical movement in pure RTL, so “left” returns to the letter just written) and state it in one help sentence.
- Custom widgets must not reuse LTR
keyCode==Left → index--. - When mixing with system fields, follow the system convention so one window does not host two arrow dialects.
- Verify: at the end of a pure Arabic word, press the “previous character” key once; the caret should land on the other side of the last letter (visual right, logical decrement). Landing at the word start or in another word means the Latin assumption remains.
Related
- Same group: C6.30.1 In right-to-left text, caret motion runs opposite visual advance · C6.30.2 In mixed-direction text, the caret at a direction switch needs extra rules to decide logical order · C6.30.3 Visual caret location and the logical insertion point may not correspond intuitively in bidirectional text
- Adjacent: C6.22 Focus order and keyboard navigation · C6.13 Text selection and caret placement
- Search:
arrow keys·logical movement·visual movement