-
-
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
Accented characters don't work with HID keyboard in X11, but do work in Wayland #5683
Comments
On X11, I can correctly inject Can you please add these logs: diff --git app/src/input_manager.c app/src/input_manager.c
index 2e4337db1..52ec3bd86 100644
--- app/src/input_manager.c
+++ app/src/input_manager.c
@@ -587,11 +587,13 @@ sc_input_manager_process_key(struct sc_input_manager *im,
}
enum sc_keycode keycode = sc_keycode_from_sdl(sdl_keycode);
+ LOGI("=== sc_keycode=%d sdl_keycode=%d", keycode, sdl_keycode);
if (keycode == SC_KEYCODE_UNKNOWN) {
return;
}
enum sc_scancode scancode = sc_scancode_from_sdl(event->keysym.scancode);
+ LOGI("=== sc_scancode=%d sdl_scancode=%d", keycode, sdl_keycode);
if (scancode == SC_SCANCODE_UNKNOWN) {
return;
} |
Thank you for your quick response! After applying your patch and reinstalling there is no change unfortunately. Still no output in log with enabled UHID keyboard in Plasma/X11. If I log into Plasma/Wayland session (where it works all right) I get the following (just for confirmation the patch is in place):
As I was curious I did more testing in GNOME session too. I discovered that the accented characters don't work both in X11 and Wayland sessions there. Here is the complete overview of all test results I did:
All tests were done with the same command line: |
It looks like an issue with your SDL then. Does it happen both with the static binary release (which includes SDL statically) and your own build (using SDL from your system)? |
I'm sorry, I have no idea how to get the static binary. I'm on the arm64 architecture and official Ubuntu repository include the ancient 1.25 version only which I believe does not have much sense to test. If you don!t think so, I can install it and test (if it already has the UHID keyboard functionality). |
https://github.com/Genymobile/scrcpy/blob/master/doc/linux.md#from-the-official-release |
Sure, I know that, but this is not for my arm64 architecture.:-( |
Oh sorry, I just read "64" 😄 |
:-) No problem at all, happens to me often too...:o) So, no other idea here? Should I check or test something? I would like to help in sorting this out. It makes no sense to me that it is OK only in the Plasma/Wayland scenario and in all other Plasma/GNOME/X11/Wayland scenarios it fails... |
You can build a static binary from your machine (with dependencies built from sources): release/build_linux.sh arm64 # it builds natively, the explicit arch name is just for filenames
release/package_client.sh linux-arm64 tar.gz You should get a static arm64 release in |
Thank you for the direction. I followed your path. I found that I have to build server too because of this line in package_client.sh:
So I need to have Android SDK? If so, please advice me how to get it. Or do I think wrong? |
Instead of calling |
Thank you a lot, this helped. After that package_client.sh passed ok. Next I replaced /usr/local/bin/scrcpy with the statically built binary from the output tarball and copied adb from the same source next to it into the /usr/local/bin/. Also replaced the /usr/local/share/man/man1/scrcpy.1 with the new built version. Running scrcpy -v gives me the following:
But when I run scrcpy --tcpip=192.168.1.110 -K --no-audio --window-height=1080 I get the following:
/usr/local/bin/ contains the following (adb and scrcpy come from the built output tarball):
And one more check:
Could you please help me with this one more? |
What is the result of |
|
OK, it's the prebuilt binary from google which is not for your arch. If you have adb installed on your system, just set ADB=adb scrcpy |
Yeah, you are right. Seems like different architecture binary. Finally got it working either by adding ADB=adb or by symlinking /usr/bin/adb to /usr/local/bin/adb. I had to symlinked /usr/local/share/scrcpy/scrcpy-server to /usr/local/bin/scrcpy-server too, otherwise it complained on its non existence. Unfortunately this exercise did not helped with the accented characters issue. I do not see any change. It still works the same, i.e. all right in Plasma/Wayland, but not in Plasma/X11. There is still no log output on typing any of those characters even with the modified app/src/input_manager.c in X11. If you have any other idea what could be checked and tested I will be happy to do that. Otherwise I have to start thinking of returning to Wayland and trying to solve other issues that forced me to go back to X11. In any case thank you a lot for your support, I appreciate it much! |
If you have some programming experience, you can write a simple sample app which listens to SDL key/text events and prints them into the console. (You can probably even ask some LLM like ChatGPT to do that for you) If you receive events on Wayland but not on X11 in your minimal sample, you should report the issue to SDL. |
Hello,
up to now I used scrcpy with simulating the physical HID keyboard for typing accented characters in Wayland without any problem. Recently I had to switch from Wayland to X11 and realized that I cannot type accented characters anymore. I'm running scrcpy with the same parameters as earlier and din't changed anything in my my Ubuntu 24.04 desktop, nor in phone. When I log back into Wayland session it works again, if I log into X11 session it still doesn't.
I realized this issue when I was using scrcpy 2.7. Unfortunately upgrade to 3.1 didn't helped here.
I did two same tests, one in Wayland, second in X11, see logs below:
Wayland log:
X11 log:
Note: I typed the same accented character at the end of the X11 test above, but nothing appeared in the log. The same do apply for any other accented characters. No log output for them at all.
The text was updated successfully, but these errors were encountered: