-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
Double input along with latin accents #650
Comments
To fix #87, since v1.4, scrcpy handles letters differently than other text (411aa4f). This is the cause of this bug. I should probably manage several "input modes" and introduce a parameter to select it, because I think there is no solution working reliably for all cases. The modes would be:
|
Started testing 1.3 and got a bunch of wildly varying results, before noticing that I was on Gboard. Thanks Google. So far it behaves as you said on 1.3, so I'll use both according to my needs. As for your solution, it seems that every options brings issues, so I don't know if it's worth pursuing instead of waiting for a fix on how adb works (dunno if even possible) or something else. |
This is not a bug in adb, just a conflict between injecting text and injecting press+release events. |
It's not caused by how adb works (#214)? Although you explained how you are handling accents on your blog, so you might be sidestepping this issue. If so I'll be here for tests, if needed. |
No. There are 2 issues:
If you inject In itself, here, the second issue should not be a problem either: it is clear that we want to inject But related to #87, when we press a letter, sometimes we want a letter (because we are typing text), sometimes we want the press+release events (typically wasd in a game). So to support this use case, all text events with letters (without accents) are ignored and raw events for letters are forwarded instead. As a consequence, now when you press In other words, even if issue 1 did not exist, you would still have the problem.
👍 |
Ah, a key up event, the game example was very clear. Now I see the problem. |
Could you add your parameter suggestion on a new release, while there's no definitive solution? Doesn't look like it should break anything since the legacy code would stay inactive unless selected. |
Yes, I planned to add an option |
Hi @rom1v , do you still plan to add the toggle on your next release? So far I've been using both 1.3 and 1.9 (.10 has the console issue), and I'm looking forward to it. |
Yes. For 1.11, in addition to what is already on
|
Expose an option to configure how key/text events are forwarded to the Android device. Fixes <#650>
I implemented it in
(extract this in your scrcpy v1.10 folder to override) Now, the text works like in v1.3: scrcpy --prefer-text-events=always # this is the default To get the behavior of v1.4→v1.10: scrcpy --prefer-text-events=non-alpha And there is another mode, which never sends text events (probably useful only for US keyboard on both the computer and the device). scrcpy --prefer-text-events=never |
I think I will simplify, and only keep the behavior of |
Working as intended here on default, thanks. Dunno how optimal this solution works for you, but I can't see a better way to do it outside of a toggle on an UI that doesn't exist now. If you got a no console build I wouldn't mind, hehe. Bundling it on the main app is a bigger headache that doing both? |
#691 is not fixed yet, so the I will probably keep the v1.10 behavior by default (and |
Expose an option to configure how key/text events are forwarded to the Android device. Enabling the option avoids issues when combining multiple keys to enter special characters, but breaks the expected behavior of alpha keys in games (typically WASD). Fixes <#650>
Done: c916af0 ( |
Testing textevents.2 but i only get the stream and 1 chance for 1 (mouse) input. After that it does not pass any input at all. Win64 version. |
@rickx Did you also recompile the server part? You should get an error in the ouput of Could you test |
hmm nope, just copied the server. I should compile it, right? That's what I get: (twice). |
On dev now. Server compilation gives me error so I'm stuck.
|
Yes, that's the problem.
This is due to a protocol issue between the client and the server ("they don't talk the same language"). |
How did you install your Android SDK?
It seems related to SDK build tools 28.0.3: #22 (comment) Could you upgrade to 29.*? |
I found out it's not possible because I was on a x386 system. Restarted with buster 64 bit. After some trouble with java I was successful, everything built fine. |
Still issues with input. I'd like to have the debug output so I added those log entries in scrcpy.c. But I get no output in cmd window (w10). Do I need to set a debug flag or something? |
Which issues? The same?
How did you build it?
By default, if you don't pass |
Well, it's something weird. It's most probably not scrcpy's fault. I have an android app written in qt. This app has some input fields which "give a twist" to the input, when the input is done through scrcpy: usually they take the first letter and the last and switch them. So e.g. HELLO becomes ELLOH.
Just
ok, that's probably the thing. Thanks. Does that mean I just remove the buildtype param? Or replace release with something else? |
Can you reproduce it by injecting the text events manually (without scrcpy):
Either remove or replace by |
Hello @rom1v, I'm running scrcpy version 1.12 (installed via snap) and I'm unable to have character as By the way, thank you for this great tool 😃 ! |
What is your keyboard on Android? |
I have AnySoftKeyboard French v. 4.0.925.2525 (on AnySoftKeyboard v. 1.10.1096.6266) but I also tried with the LineageOS 16 stock keyboard and it doesn't work (I tried on two different phones with LOS 16 : Samsung Galaxy S5 and Samsung Galaxy S5+). edit : I have also the same problem with Samsung Galaxy S3 and LineageOS 14.1 stock keyboard |
Hello, While using Thanks |
|
ASCII is on 7 bits, so it contains only values up to 127. I don't know what are the values you provide, since they are not latin1/cp1252/iso8859-1 either. |
I see, so it only supports the non-extended ASCII table. Would it be possible to implement support for the rest ? |
This is a limitation on Android on key injection. There are alternatives (like installing a separate app containing IME), see #37 and related. |
|
Hello.
I'm using the suggested keyboard app in #431 on my main phone and the stock version of LineageOS keyboard on my secondary phone, and both are able to type accented (áèîõü) characters as explained in https://blog.rom1v.com/2018/03/introducing-scrcpy/#handle-text-input.
However, when inputing [accent] then [key], scrcpy isn't able to recognize that I want a accented character only, so áá turns into aáaá. Is it possible to filter the output when I type an accent, like by just skiping the first output?
Thanks for the project, it was a lifechanger ever since its first release.
The text was updated successfully, but these errors were encountered: