Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
108.84k stars 10.47k forks source link

Shake feature #2546

Open scarlac opened 3 years ago

scarlac commented 3 years ago

Is your feature request related to a problem? Please describe. I searched the repo for 'shake' and found an old PR: https://github.com/Genymobile/scrcpy/pull/85 that was renamed to app_switch which is actually what it did. I don't see how it ever shook the device but maybe I don't have the context.

Describe the solution you'd like I'd like a hotkey that enables me to trigger a shake gesture since it can be hard to do physically with Android devices. This is helpful when doing React Native development where the shake gesture triggers the development menu.

Describe alternatives you've considered

  1. Physically shaking the device; or
  2. With React Native specifically I can switch to my terminal and attempt to trigger the dev menu (but it doesn't always work); or
  3. Using Keyboard Maestro I can make a macro that triggers a shell script (adb shell input keyevent 82)
rom1v commented 3 years ago

Alt+m or Alt+s?

scarlac commented 3 years ago

Ah, I see MOD+m will "shake" the device. I did not think to try that. Should this be documented? Also, I have MOD+m mapped to minimize window globally so I can't really use this hotkey but at least it exists. Feel free to close it if you feel it shouldn't need more documentation

bendix80 commented 2 years ago

Hi, Mod + m is not working for me when connected to my Amazon fire hd 🤷🏻‍♂️

Anyone else having that issue with a tablet or smartphone?

All other shortcuts work as expected with this fabulous piece oft software 🙏🏼

Greetings

rom1v commented 2 years ago

Does adb shell input keyevent MENU work?

bendix80 commented 2 years ago

thx for your fast reply. yes, this command unlocks the locked screen of my amazon fire hd 10. but it won't shake when entered again. same with "adb shell input keyevent 82"

maybe the "shake-amount" is different on tablets? or is shake = shake as a kind of shortcut on every device?

bendix80 commented 2 years ago

Hey Folks, Any ideas how to solve the not shaking problem?

Anyone else able to check that on a fire HD tablet? Maybe it is the modified Amazon android version 🤷🏻‍♂️

Greetings

ghost commented 2 months ago

Has the feature been introduced into scrcpy? How can I shake the device via a shortcut?

rom1v commented 2 months ago

MOD+m https://github.com/Genymobile/scrcpy/blob/master/doc/shortcuts.md

ghost commented 2 months ago

MOD+m https://github.com/Genymobile/scrcpy/blob/master/doc/shortcuts.md

It doesn't work for me. I'm using AliExpress app which features "shake the device for taking part in a lottery". I do press LeftALT+M but nothing happens.

rom1v commented 2 months ago

"shake the device for taking part in a lottery"

It's probably based on the accelerometer (to physically "shake" the device), not a specific key pressed.

ghost commented 2 months ago

"shake the device for taking part in a lottery"

It's probably based on the accelerometer (to physically "shake" the device), not a specific key pressed.

Oh, I see. LeftALT+M works for me when I'm unlocking the phone but it doesn't do anything when the phone is unlocked.