Skip to content

Android: Labs › Hold delay - #2964

Draft
R44VC0RP wants to merge 8 commits into
devfrom
android-hold-delay
Draft

R44VC0RP wants to merge 8 commits into
devfrom
android-hold-delay

Conversation

@R44VC0RP

Copy link
Copy Markdown
Collaborator

From a Hex Preview tester's feedback that Ryan tagged: "please allow me to adjust the duration of a long press".

What changes

New row, Labs › Keyboard › Hold delay, with three steps. Default is exactly today's timing, so the lab is off until someone picks another step.

Step Letters, digits, period, pads (accents and symbols) Space bar's hold
Short 200 ms Android's delay × 2/3 (400 ms → 266 ms)
Default 300 ms (today's KeyboardMetrics.HOLD_MS) Android's touch-and-hold delay (today's; 400 ms unless changed in Accessibility)
Long 500 ms Android's delay × 5/3 (400 ms → 666 ms)

Where the values come from:

  • Gboard: Settings › Preferences › Key long press delay is a slider from 100 to 700 ms, 300 ms by default (keyboardapps.net, techbone). Short and Long sit inside it, short of its ends, so a fast typist's ordinary press doesn't become a hold, and Long stays well under Android's Medium.
  • Android: Accessibility › Touch & hold delay is Short 400 ms / Medium 1000 ms / Long 1500 ms. The space bar has always followed that setting, so Default keeps it; Short and Long scale it by the same share as the letters, so the space bar always waits longer than a letter and still respects someone who set a long system delay.

Pop-ups, haptics, the release tick and Delete's repeat are unchanged. With Labs › Hold space to move the cursor (#2963) the same space-bar delay starts the trackpad.

Wording for Ryan to approve

English 简体中文
Row Hold delay 长按延迟
Detail How long to hold a key before its accents and symbols, or the space bar’s hold, kick in 按住按键多久后显示重音字母和符号,或触发空格键的长按操作
Steps Short · Default · Long 短 · 默认 · 长
Step note 200 ms · 300 ms · 500 ms 200 毫秒 · 300 毫秒 · 500 毫秒

The row shows the chosen step and opens a list like Key colors › Color.

Checks

  • :app:testDebugUnitTest: 400 tests pass, including the new holdDelayDefaultKeepsTodaysTimingAndTheSpaceBarScales (InsertionTest.kt): Default equals HOLD_MS and leaves any system delay as is, unknown or missing values read as Default, and every step's space-bar delay stays above its letter delay.
  • Release build: :app:minifyReleaseWithR8 passes.
  • API 36 emulator, timed on the device: a held e showed its accents at 240 ms only with Short, at 350 ms with Default but not Long; a 520 ms space-bar hold opened the language menu with Short and Default but not Long. Settings row and list checked in light and dark, English and Chinese. Screenshots are with the coordinating session.

Notes

A tester asked to keep the space bar's hold for moving the cursor: today a
still hold opens the dictation-language menu and ends the press, so hold
then slide never moves the cursor. With the new lab on, a still hold for
Android's touch-and-hold delay turns the space bar into a trackpad (a click
says it took), one character per 12.6 dp from where the finger was held, as
iPhone Hex's trackpad, and lifting types nothing whether or not it moved.
Taps and plain slides are unchanged. The language stays in the Hex menu's
Language page, and TalkBack's long click on the space bar still opens it.
Off (the default), holding opens the menu exactly as before.

Verified: :app:testDebugUnitTest (400 tests, including the new
aHeldSpaceBarMovesTheCursorFromWhereItWasHeldAndTypesNothing) and the
release build's R8 step pass; on an API 36 emulator, hold-slide moved the
cursor, hold-release typed nothing, a tap typed a space, and with the lab
off the hold opened the language menu.
A tester asked to adjust how long a long press takes. Letter holds used a
fixed 300 ms and the space bar Android's touch-and-hold delay. The new
Labs › Keyboard › Hold delay row offers Short (200 ms), Default (300 ms)
and Long (500 ms), inside Gboard's Key long press delay slider (100 to
700 ms, 300 default). Default is today's timing exactly, so it is the lab
off. The space bar keeps Android's delay at Default and is scaled by the
same share otherwise (400 ms becomes 266 or 666 ms), so it always waits
longer than a letter. Pop-ups, haptics and Delete's repeat are unchanged.

Verified: :app:testDebugUnitTest (400 tests, including the new
holdDelayDefaultKeepsTodaysTimingAndTheSpaceBarScales) and the release
build's R8 step pass; on an API 36 emulator a held e showed its accents at
240 ms only with Short, at 350 ms with Default but not Long, and a 520 ms
space hold opened the language menu with Short and Default but not Long.
Anomaly added 3 commits November 28, 2026 18:12
dev pruned the Android feature-map tree from docs/features/README.md (#2979), so
that file takes dev's version; the lab's row in android/README.md is kept before
**Keyboard › Spatial autocorrect**, and the HexSettings and TypingPreferences
conflicts keep both sides' rows (Delete words when held, then Hold space to move
the cursor).
Conflicts are adjacent additions: the Page list and its Labs parent keep Hold
delays and Sounds; the Labs card keeps Delete words when held, then Hold delay;
the page switch keeps both cards. dev's reworked hold in typesOnLift is kept
(talks, flick and Click when a hold opens) with its delay now read from
TypingPreferences.holdDelay; docs/features/README.md takes dev's pruned version
(#2979) and the lab's row in android/README.md is kept.
The space bar's hold is now one line: #2963's holdSpace, scheduled with
#2964's delay (HoldDelay.space). The Labs card and android/README.md keep the
Hold delay row and the Hold space to move the cursor row, both kept across the
merge of origin/dev.
R44VC0RP pushed a commit that referenced this pull request Nov 28, 2026
The space bar's hold is now one line: #2963's holdSpace, scheduled with
#2964's delay (HoldDelay.space). The Labs card and android/README.md keep the
Hold delay row and the Hold space to move the cursor row, both kept across the
merge of origin/dev.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant