-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Add support for CTRL+S to send hardware "shake" to device #85
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Thank you for the PR. 👍 Adding this shortcut is a good idea.
"Shake" seems very specific to React Native, so it seems to me that MENU
is a better name. Could you rename it, please?
(Please edit your commits to apply the changes, using git rebase
: this whole PR could fit in only 1 commit, since it is a single technical/functional change.)
Also, could you change its target from master
to dev
, please? The idea is that the "home page" of the project should always contain valid information for the current (latest) release.
README.md
Outdated
@@ -258,6 +258,7 @@ To run without installing: | |||
| click on `HOME` | `Ctrl`+`h` \| _Middle-click_ | | |||
| click on `BACK` | `Ctrl`+`b` \| _Right-click²_ | | |||
| click on `APP_SWITCH` | `Ctrl`+`m` | | |||
| shake device | `Ctrl`+`s` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency:
click on
MENU
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are also shortcut descriptions for scrcpy --help
in main.c
. Could you also add one for MENU
below APP_SWITCH
like here?
@atrich Do you want me to apply the requested changes for you? |
@rom1v Sorry for the delay - I believe I have responded to the feedback, rebased, and am requesting a merge into |
The action sends AKEYCODE_MENU, so just name it "menu". See <#85>.
Add support for CTRL+S to send hardware "shake" to device
Thank you 👍 I also swapped the shortcuts to avoid confusion: 88ee6bc |
This can not work on my MacOS , short press ctrl+M trigger APP_SWITCH, the same as command+S, and long press ctrl+M well trigger shake device , I don't know why must be long press? |
Actually, Lines 157 to 161 in 8ec077c
scrcpy/app/src/input_manager.c Lines 310 to 321 in 8ec077c
I don't really know what "shake device" is in practice, but for example in the VLC app, Note that you can inject these events manually via adb shell input keyevent APP_SWITCH
adb shell input keyevent MENU |
I mean short press |
I don't know how it's even possible, looking at the source code. 😕 What is the result of |
It's a strange problem, maybe it's not a general problem, have you test on MacOS ? |
@ihwf Haven't tested this feature, but
|
When developing for React Native, shaking the physical Android device is how you pull up the React Native debug menu, which is a very common task.
This catches the CTRL+S key combination and maps it to the "shake" keycode (keycode 82, AKEYCODE_MENU).