Repository navigation
Type in any language through a bridge keyboard - #11
Open
logicalangel wants to merge 1 commit into
Open
logicalangel wants to merge 1 commit into
logicalangel wants to merge 1 commit into
Conversation
scrcpy's text injection only carries characters Android's virtual key map has, so Persian, Russian, Chinese or Japanese typed on the Mac never arrived. The bridge now has an input method (MacInputMethod) with no keys on screen, which app windows select with `ime set` unless Android's on-screen keyboard is turned on. The window's view is an NSTextInputClient, so every layout, dead key and input method works. While an editor on the window's display has input, text, composing text (shown underlined in the app) and editing keys go to the input method over the abstract socket msa_ime, in order; otherwise text and keys go through scrcpy as before. Only the shell user and root may connect to the socket, which stays up for the bridge's process since Android recreates the service. Bridge version 2.
This branch has not been deployed
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.
Typing Persian, Russian, Chinese and other non-Latin text didn't reach Android: scrcpy's INJECT_TEXT drops characters outside Android's virtual key map ("Could not inject char"). This adds an input method to the bridge, with no keys on screen, that commits what the Mac's text input produces, including composing text from Pinyin or Kana. Windows select it with
ime setunless Android's on-screen keyboard is turned on. With no editor focused, keys and text still go through scrcpy, so games and shortcuts are unchanged.Tested on LineageOS 24: Persian, English, Delete and Enter typed in Settings' search; Persian, Russian and Chinese (committed and composing) sent through the socket.
Bridge version 2. It touches AndroidDisplayView.swift next to #10; I'll rebase whichever lands second.