-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
2 fingers tap & move: distinguish between zoom and scrolling #5317
Comments
Scrcpy injects finger touch events to the device, how it reacts is handled by Android. |
thanks for you answer ; maybe if there was a way to inject positions of the the fingers movement so that the distance between them does not change ; |
Thanks for the link. Indeed I do use the ctrl+click feature. Actually as with ctrl we do have the zoom/rotate, I think what is missing for me is the 2 fingers swipe |
Vertically or horizontally? Vertically, you can use Shift+click. |
Thanks for pointing that out, I did not really understand that "tilt" was équivalent to a vertical 2 fingers swipe ; However on my device (samsung s10 and scrcpy 1.12.1+ds-1 on ubuntu) Shift+click does not seam to do anything. sudo apt install --only-upgrade scrcpy scrcpy -v Dependencies (compiled / linked):
|
You probably installed several versions in different ways. Don't use the package from your Debian/Ubuntu distribution, they are completely obsolete/outdated. Uninstall it and install the latest version (currently 2.7): |
Thanks! shift+click now works. I also tried several other methods that didn't work:
|
|
Thanks to your help and my hack, this is done! |
What is your concrete use case for horizontal "sliding"? |
I am using a drawing app on my phone (Krita or Simple Draw), for making schemas, take notes, grow ideas. |
To add Ctrl+Shift for horizontal tilt, I think this is sufficient: diff --git a/app/src/input_manager.c b/app/src/input_manager.c
index 3c7022b0f..879a9df3a 100644
--- a/app/src/input_manager.c
+++ b/app/src/input_manager.c
@@ -794,7 +794,7 @@ sc_input_manager_process_mouse_button(struct sc_input_manager *im,
}
bool change_vfinger = event->button == SDL_BUTTON_LEFT &&
- ((down && !im->vfinger_down && (ctrl_pressed ^ shift_pressed)) ||
+ ((down && !im->vfinger_down && (ctrl_pressed || shift_pressed)) ||
(!down && im->vfinger_down));
bool use_finger = im->vfinger_down || change_vfinger;
@@ -835,7 +835,7 @@ sc_input_manager_process_mouse_button(struct sc_input_manager *im,
sc_screen_convert_window_to_frame_coords(im->screen, event->x,
event->y);
if (down) {
- im->vfinger_invert_x = ctrl_pressed || shift_pressed;
+ im->vfinger_invert_x = ctrl_pressed ^ shift_pressed;
im->vfinger_invert_y = ctrl_pressed;
}
struct sc_point vfinger = inverse_point(mouse, im->screen->frame_size, Could you confirm, please? |
Use Ctrl+Shift for horizontal tilt. Refs #4529 comment <#4529 (comment)> Fixes #5317 <#5317>
Please review/test 7a9ea5c. |
That works perfectly, thanks :) |
Merged into |
Because it has been merged after the latest release. It will be in the next one: |
@rom1v how is tilt not 2 finger (laptop) touchpad scroll? |
Scrcpy sends 2 fingers at the specified location to Android. The Android system reacts as it wants. |
Hello,
That would be great if there would be a way to distinguish, for the 2 finger tap, between a gesture where two fingers are spread apart (like for zooming) and a gesture where two fingers are moved together without changing the distance between them (like for scrolling the screen)
Thanks,
Is your feature request related to a problem? Please describe.
Some software like Krita requieres zoom and scrolling, and to distinguish them (otherwise it randomly do both of them)
Describe the solution you'd like
a set of keys (like ctrl, ctrl+alt, or a letter if necessary) to distinguish them
Describe alternatives you've considered
N/A
The text was updated successfully, but these errors were encountered: