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

[Feature Request] Add Option to Prevent Mouse Capture with --mouse=uhid #5916

Open
1 task done
chapas opened this issue Mar 12, 2025 · 2 comments
Open
1 task done

Comments

@chapas
Copy link

chapas commented Mar 12, 2025

Is your feature request related to a problem? Please describe.
Yes, my feature request is related to a problem with the mouse being locked inside the scrcpy window. I’m always frustrated when I use scrcpy to control my Android device with the --mouse=uhid option on Windows, and the mouse gets trapped inside the window after I start interacting with it. I have to do ALT+TAB or find another way to free the mouse, which is inconvenient because I need to switch between controlling my device and using other programs on my PC without extra hassle.

Describe the solution you'd like
I’d like scrcpy to have an option, like --no-mouse-capture, that lets me use my PC mouse to control my Android device when it’s inside the scrcpy window but doesn’t lock it there. When I move the mouse outside the window, it should just work on my PC normally without being trapped. For example, I could run scrcpy --mouse=uhid --no-mouse-capture, and the mouse would only control the device when it’s over the window, then move freely outside.

Describe alternatives you've considered
Not using the --mouse=uhid option and use touches.

Additional context
I’m using scrcpy 3.0.2 on Windows 10 to control my Samsung S22.
My current working command is:
scrcpy --serial=R5xxxxxxx6V --window-title=S22 --mouse=uhid --stay-awake --audio-buffer=100 --max-size=2336 --legacy-paste --max-fps=60 --turn-screen-off

@rom1v
Copy link
Collaborator

rom1v commented Mar 12, 2025

I have to do ALT+TAB or find another way to free the mouse

Just press Alt.

that lets me use my PC mouse to control my Android device when it’s inside the scrcpy window but doesn’t lock it there. When I move the mouse outside the window, it should just work on my PC normally without being trapped

The behavior would be very strange, because as you would control your device, the mouse would automatically (randomly) switch to the desktop just because it happens that the distance you moved the mouse would make the desktop pointer leave the window.

@chapas
Copy link
Author

chapas commented Mar 12, 2025

I have to do ALT+TAB or find another way to free the mouse

Just press Alt.

that lets me use my PC mouse to control my Android device when it’s inside the scrcpy window but doesn’t lock it there. When I move the mouse outside the window, it should just work on my PC normally without being trapped

The behavior would be very strange, because as you would control your device, the mouse would automatically (randomly) switch to the desktop just because it happens that the distance you moved the mouse would make the desktop pointer leave the window.

Thanks for the fast answer, Alt just works, it's just that I'm using it full screen on a separate monitor and it would be very handy to have it.

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