Keyboard hit areas that follow the user's taps (a personal touch model)
keyboardimetouchheat-mapautocorrectstatisticspersonalization
People do not tap the centers of keys. Each person drifts in a consistent direction per key (Justin's taps on i and o land up and to the left), and a fixed key grid turns that drift into typos ("i" when "o" was meant). A personal touch model measures each key's drift from logged taps and quietly moves the invisible boundaries between keys, while the drawn keyboard stays the same. Built into Justin's Keyboard in v1.29.0 and v1.30.0 (2026-10-28); the tap log itself is described in Keyboard, Justin's Android input method (overview and canon).
The data and its bias
The tap heat map records where each tap landed relative to the key it hit, in small bins. That label is the key hit, not the key meant: an o tap that landed on i is counted as an i tap near i's right edge, and is missing from o's distribution. So o's spread is cut off on the side where it drifts.
Consequence: center each key on the peak of its taps, not the mean. The cut-off tail drags the mean back toward the middle and under-estimates the drift; the densest spot barely moves. Per key, take the column and row marginals, find the densest cell, and refine it with a 3-point parabola through that cell and its neighbors. At an edge cell (where the cut-off happens) use the mean of it and its inner neighbor. Justin suggested the peak after the first build used the mean.
Shrink, then cap
One person's data is thin, so shrink each key's estimate toward its row: - key = w·peak + (1 − w)·rowDrift, with w = n / (n + 60) for n taps on that key; - the row's own drift is shrunk toward zero the same way; - keys with fewer than 20 taps do not move; - cap the shift at ¼ of a key width horizontally and ⅕ vertically, so the grid can never become unusable; - use the last 30 days of taps, or all of them while there are fewer than 300.
Only character keys move. Space, shift, backspace, enter and the symbol-page key keep their areas: a mis-hit there is costly and not a typo.
Moving boundaries, not keys
Hit testing uses the shifted centers: the line between two neighbors sits at the midpoint of their shifted centers, and rows split the same way. Nothing on screen moves, which avoids a keyboard that visibly wanders.
Keep recording new taps relative to the key they resolved to under the moved boundaries, so the model converges over rounds instead of chasing itself.
Relabeling taps from corrections
When the user fixes a one-letter typo (autocorrect, a manual fix, or a suggestion pick), the last tap of that letter was really meant for the other key. Move that tap in the log to the meant key ("retap"), measured from that key's own frame. Undoing the correction moves it back. This fills in exactly the taps the heat map was missing.
Feeding autocorrect
The same drift tells autocorrect which substitutions are likely. For each typed→meant pair of neighboring keys, compute how much more likely a tap crosses their boundary given the measured drift than with none, assuming a normal spread per key (standard deviation from the bins, clamped to a sane range, needs 20+ taps):
ease = ln(P(cross | drift) / P(cross | no drift)), clamped to 0..2
Subtract the part of the shift the hit areas already absorbed, so the two mechanisms do not double count. The ease lowers the substitution cost in the dictionary search, combined with learned slip habits as min(4, max + ½·min). A simulation over the top 3,000 words with a synthetic left-drifting o fixed 30 more i-for-o typos per thousand and changed almost nothing for unrelated substitutions. See Keyboard autocorrect, next-word prediction and learning.
Orientation
Portrait and landscape grips drift differently. Store orientation with each tap and build a model per orientation. While one orientation has little data, shrink it toward the other's drifts instead of toward zero; a key with fewer than 20 taps takes the other orientation's drift whole.
Making it visible and optional
A setting "Adapt keys to my taps" (on by default) and a "Show hit areas" overlay on the heat-map page: lines where areas end and dots where each key's taps land most. A Portrait/Landscape switch appears once landscape taps exist. Everything stays on the phone, like the rest of the personal data.
Testing it
Seed the heat table directly (adb root + sqlite3 on the emulator) with a known drift, then tap at measured pixel offsets: a tap 10 px left of o's drawn edge produced "o" with adaptation on and "i" with it off, and the crossover sat where the model predicted.
Why not a neural network
The plain statistics above won over a learned model; the reasons are in Keyboard autocorrect, next-word prediction and learning. Every number here can be shown on the heat-map page.
See also
- Keyboard, Justin's Android input method (overview and canon)
- Keyboard autocorrect, next-word prediction and learning
- Writing an Android keyboard (InputMethodService)