fix: enable host keyboard passthrough in AVDs (hw.keyboard=yes)#1
Merged
Conversation
avdmanager's device profiles generate config.ini with hw.keyboard=no, which silently drops physical (Mac) key events — you tap a text field, the on-screen keyboard shows, but typing on the host does nothing. Flip it to hw.keyboard=yes so the host keyboard types into the guest. The soft IME still appears because the system images keep show_ime_with_hard_keyboard=1, so you get both keyboards. - emulator::with_hw_keyboard_enabled(): pure config.ini transform that flips/append the bare hw.keyboard key without touching hw.keyboard.charmap or hw.keyboard.lid (+ unit tests). - provision: apply it on every cold boot, so AVDs created by an older andro heal automatically — no `andro clean` required. Verified end-to-end: a real boot rewrites config.ini (no→yes) and the regenerated hardware-qemu.ini reports hw.keyboard = true, with the guest exposing an active qwerty2 hardware keyboard. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
🎉 This PR is included in version 1.1.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Typing on the host (Mac) keyboard does nothing in the emulator.
avdmanager's device profiles generateconfig.iniwithhw.keyboard=no, which silently drops physical key events — you tap a text field, the on-screen keyboard appears, but the host keyboard is dead. (Diagnosed live:mInputShown=trueand the soft IME renders fine; the gap was the physical keyboard.)Fix
Flip the AVD to
hw.keyboard=yesso the host keyboard types into the guest. The on-screen IME still shows because the system images keepshow_ime_with_hard_keyboard=1— so you get both keyboards.emulator::with_hw_keyboard_enabled()— pureconfig.initransform that flips/appends the barehw.keyboardkey without touchinghw.keyboard.charmap/hw.keyboard.lid(+ 4 unit tests).provision— applied on every cold boot, so AVDs created by an olderandroheal automatically (noandro cleanneeded). Covers both the phone and TV profiles.Verification
cargo test(39 unit + 11 integration) green,clippyclean.andro up:config.inirewrittenno→yes, regeneratedhardware-qemu.inireportshw.keyboard = true, guest exposes an activeqwerty2hardware keyboard, andshow_ime_with_hard_keyboardstays1.🤖 Generated with Claude Code