Skip to content

fix(ime): don't force the soft keyboard up when a hardware keyboard is attached - #266

Open
GlassOnTin wants to merge 2 commits into
connectbot:mainfrom
GlassOnTin:ime-no-show-forced-with-hardware-keyboard
Open

fix(ime): don't force the soft keyboard up when a hardware keyboard is attached#266
GlassOnTin wants to merge 2 commits into
connectbot:mainfrom
GlassOnTin:ime-no-show-forced-with-hardware-keyboard

Conversation

@GlassOnTin

Copy link
Copy Markdown
Contributor

showIme() passes SHOW_FORCED unconditionally. That flag is documented to keep the IME open "until the user explicitly closes it", which overrides the platform's own rule that a usable hardware keyboard suppresses the soft one.

The visible effect is on devices where a real keyboard is the primary input. This came in as a bug report against a Meta Quest 3 with a Bluetooth keyboard attached: every keypress raised the on-screen keyboard over the terminal session.

Passing no flags in that case hands the decision back to the platform, which still honours the user's "show virtual keyboard" setting for anyone who genuinely wants both on screen.

Why hardKeyboardHidden is in the test

Checking Configuration.keyboard alone isn't enough — a folded or undocked device reports KEYBOARD_QWERTY while the keys are physically unreachable. There the soft keyboard is the only way to type, so SHOW_FORCED still earns its keep.

Shape

The policy is a top-level imeShowFlags(keyboard, hardKeyboardHidden) rather than a method reading resources.configuration, so it can be tested from plain Configuration constants without a Context. ImeShowFlagsTest covers all four combinations, and I confirmed each assertion fails against an unconditional SHOW_FORCED before trusting it.

What I haven't verified

I don't have a Quest 3. The mechanism is documented and matches the reported symptom exactly, but whether it's the whole cause on that device is unconfirmed — I've asked the reporter to test it. Happy to hold this until they come back if you'd rather.

Carried downstream in the Haven fork, where it ships in the next release.

…s attached

showIme() passes SHOW_FORCED unconditionally. That flag is documented to keep
the IME open "until the user explicitly closes it", which overrides the
platform's own rule that a usable hardware keyboard suppresses the soft one.

The visible effect is on devices where a real keyboard is the primary input:
reported on a Meta Quest 3 with a Bluetooth keyboard, where every keypress
raised the on-screen keyboard over the terminal. Passing no flags in that case
hands the decision back to the platform, which still honours the user's "show
virtual keyboard" setting for anyone who wants both.

hardKeyboardHidden is part of the test rather than Configuration.keyboard
alone: a folded or undocked device reports KEYBOARD_QWERTY while the keys are
physically unreachable, and there the soft keyboard is the only way to type, so
SHOW_FORCED still earns its keep.

The policy is a top-level imeShowFlags(keyboard, hardKeyboardHidden) rather
than a method reading resources.configuration, so it can be tested from plain
constants without a Context. ImeShowFlagsTest covers all four combinations and
was confirmed to fail against an unconditional SHOW_FORCED.

Not verified on a Quest 3 — I don't have one. The mechanism is documented and
matches the reported symptom, but whether it is the whole cause on that device
is unconfirmed.
GlassOnTin added a commit to GlassHaven/Haven that referenced this pull request Aug 8, 2026
Four issues from this week's reports, plus a build-infrastructure fix that
main needed.

#515 — toolbar arrows latching into a dead state after a hold, and the soft
keyboard not coming back after backgrounding. Two independent latches for the
first; core:toolbar gained its first test source set, which is why the bug
shipped in the first place.

#511 — the virtual keyboard covering the session on a Meta Quest 3 with a
physical keyboard attached. Unverified on that hardware; the reporter has been
asked to confirm. The termlib half is upstreamed as connectbot/termlib#266.

#516 — Campbell, Modern Dark and Modern Light colour schemes, transcribed from
the upstream projects rather than approximated.

#514 — release pages now explain the two APK flavours instead of leaving six
filenames unexplained.

Also carried: mirror fallbacks for the pinned native sources. code.videolan.org
went dark on 2026-08-08 and took down both this repo's CI and the F-Droid build
of 5.87.1 at the x264 clone. Mirrors are fetched by commit, so the existing pin
verification is unchanged and they buy availability rather than trust.
CI runs spotlessKotlinCheck, which Haven's fork does not, so this only showed
up here. Single-expression function on one line.
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