Skip to content
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

Keyboard sdk doesn't forward super, uhid doesn't work at all #5808

Open
Pecacheu opened this issue Jan 31, 2025 · 2 comments
Open

Keyboard sdk doesn't forward super, uhid doesn't work at all #5808

Pecacheu opened this issue Jan 31, 2025 · 2 comments

Comments

@Pecacheu
Copy link

Environment

  • OS: Windows 11
  • Scrcpy version: v3.1
  • Installation method: Binary release
  • Device model: Galaxy S24U
  • Android version: 14

Describe the bug

Hi, I'm trying to run DeX through scrcpy, and I mostly have it working, but I'm having keyboard-related issues. Under the default settings, keyboard input works fine, except for two problems: Firstly, the super/windows key isn't forwarded (this is annoying because this key is used by DeX), and secondly, the on-screen-keyboard won't go away because my phone is NOT detecting a physical keyboard present despite my typing.

I read the Keyboard guide and decided to try uhid mode with --keyboard=uhid and/or the -K option... When I enable this, a physical keyboard is detected by DeX and my second problem of the above is solved, OSK disappears. But now no matter which key I press, nothing happens. No input is forwarded at all!

@rom1v
Copy link
Collaborator

rom1v commented Jan 31, 2025

Firstly, the super/windows key isn't forwarded

Because by default it is captured for scrcpy shortcuts. It can be changed: https://github.com/Genymobile/scrcpy/blob/master/doc/shortcuts.md

But now no matter which key I press, nothing happens. No input is forwarded at all!

Does it work with "normal" screen mirroring (not DeX)?

Does UHID mouse work?

Does AOA keyboard/mouse work?

Check adb logcat for any errors, and add -Vverbose to scrcpy to check that the inputs are correctly injected.

@Pecacheu
Copy link
Author

Pecacheu commented Feb 3, 2025

Thanks for the help!

After testing with a normal screen mirror (no extra options to scrcpy besides -K), it worked... UHID mouse mode works too. Then when I went back to my usual options, UHID works in DeX too... That's super weird, even today it wasn't working until then. Maybe the normal screen mirror without display-id option somehow triggered UHID into life? As for AOA, it seems to work too but I can't screen mirror while using it, so it wouldn't be very useful to me.

Additionally adding --shortcut-mod=rctrl or similar seems to forward the Super key! I didn't know about that keybinding. It seems that Windows still also processes the keypress so every time you press the key it opens the Start menu, which is a bit annoying, but it still gets forwarded if the scrcpy window is in focus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants