fix(android): send Ctrl for the command modifier so cmd+a selects all - #480
mobile-kevin wants to merge 1 commit into
Conversation
io keys documents cmd+a as select-all, but Android mapped the "command" modifier to KEYCODE_META_LEFT. Meta+A opens the Google Assistant instead of selecting text, so every documented cmd-based shortcut (select-all, copy, paste) did the wrong thing and pulled the app out of the foreground. Android's primary shortcut modifier is Control, so map "command" to KEYCODE_CTRL_LEFT. iOS keeps mapping it to Command, where cmd+a already selects all.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: mobile-next/mobilecli/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughAndroid’s ChangesAndroid modifier mapping
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~5 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to Android 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Problem
io keysdocumentscmd+aas select-all, but on Android the "command" modifier mapped toKEYCODE_META_LEFT. Meta+A opens the Google Assistant instead of selecting text, socmd+a/cmd+c/cmd+vall did the wrong thing and yanked the app out of the foreground.Fix
Android's primary shortcut modifier is Control, so map the canonical "command" modifier to
KEYCODE_CTRL_LEFT. iOS still maps it to the Command key, wherecmd+aalready selects all. (cmd,commandandmetaall normalize to "command" upstream, so they now all send Ctrl on Android — matching the documented select-all semantics.)Tests
commandandcontrolboth map toKEYCODE_CTRL_LEFT, andcommandmust not map to Meta.cmd+a+ backspace cleared it, and the foreground stayed on the app (the Assistant no longer opened).Summary by CodeRabbit