-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP]Support inject unicoe text #903
Conversation
f9ce19b
to
f24a033
Compare
This won't work, because the moment you disconnect the device, the app will still be the default keyboard. |
4 SDL Events here: SDL_TEXTINPUT, SDL_TEXTEDITING, SDL_KEYDOWN, SDL_KEYUP I think inputtext event and key event are two completely different events and should not be converted to each other. when android device edit text area is focus, You definitely want to enter text, you care about the hold text, not a single character Scrcpy splits text into character arrays to handle:
but, a lot of text is 2 or even 4 bytes of unicode string, which cannot be split into a single char. this commit work for me, ctrl+e to use customer IME to input chinese, ctrl+shift+e to use the original injectKeyEvent to play game BTW, |
vysor use a Custom IME method to enter text |
Thank you for your work. Supporting non-ASCII characters is a feature which is requested a lot (especially for Chinese or other non-ASCII languages), so that's great 👍 I did not have time to review or test yet (I would like to finish things to be fixed for v1.11, and maybe investigate the new audio API first), but it's in my TODO list :)
Yes, I agree. It's just a constraint from key injection. However, on the computer, when you press
Exactly, that's #87. And on (Btw, you should target
This is even worse than that, this method only works for ASCII text (on 7 bits) (note that Questions:
|
@rom1v Thank you for your reply and endure my poor English. :)
Yes, I agree. The main problem is that we can't know which component(device, android ui) is being focused. SDL provides two methods, let developers choose whether to send inputtext event.
But, the scrcpy app(computer side) does not have an EditText component. So, just on the scrcpy side, it’s difficult to decide when to start and to stop textinput. But unfortunately, I am trying hard to get IME and scrcpy server to communicate directly with each other. This won't work. app_process app can send broadcast but can not recv. This is too complicated ! In order to enter text, this is too expensive. The
As it is now, yes. But as I said above, this can be smarter.
yes, it works |
Oh, you should not do that, but rebase instead, to get a clean reviewable patchset in the end. :) |
* add switch cmd 'ctrl+e' to enable and use ime, 'ctrl+shift+e' to disable ime * change original handler behavior: * change text_input to send all types char * when enable IME, injectKeyEvent skip Letter or Digit or Space char, InjectText to handler it * when disable IME, InjectText skip all text, injectKeyEvent to handler it
61a22d0
to
1d3d8b2
Compare
Is it possible to do it using root instead of an additional keyboard app? |
Closed because implemented? |
Refer to the Vysor method, add a custom ime to enter unicode characters
[WIP]