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

Switch control shortcut option for pc to android or android to pc #4919

Open
idlukakas opened this issue May 13, 2024 · 5 comments
Open

Switch control shortcut option for pc to android or android to pc #4919

idlukakas opened this issue May 13, 2024 · 5 comments

Comments

@idlukakas
Copy link

By using the command scrcpy.exe -KM --no-video, I can only gain control of the Android device if I click on the scrcpy window, and to release control back to the PC, I need to press Alt. It would be nice if I could switch control between the PC and the Android device using a shortcut.

Perhaps using an option like: scrcpy.exe -KM --no-video --switch-control-shortcut

@rom1v
Copy link
Collaborator

rom1v commented May 13, 2024

The SDL window must have focus to receive keyboard (or mouse) events.

@idlukakas
Copy link
Author

idlukakas commented May 14, 2024

Scrcpy server can bind some shortcut from the desktop OS to gain focus on it's window if possible.

@idlukakas
Copy link
Author

I did: scrcpy.exe --stay-awake --push-target=/sdcard/ --no-video -KM --window-height=50 --window-width=50 --window-x 940 --window-y 1090 --window-borderless

Then I set AutoHotKey to gain focus the scrcpy window and click on it automatically when I press Alt + S

Thanks for explain the behavior

@rom1v
Copy link
Collaborator

rom1v commented May 15, 2024

Refs https://wiki.libsdl.org/SDL2/SDL_SetWindowKeyboardGrab (but not sure this allows to do what we want)

@idlukakas
Copy link
Author

Good to know. Who knows, it could be reachable for using 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