-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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.6 mouse issues #5162
Comments
If you just click (with a secondary button), it is the same behavior as v2.5… and earlier versions. What changes is only when you Shift+click, there are new bindings. |
not exactly same, for example: in 2.5-, holding left button and dragging, works same as middle button scrolling; but in 2.6, holding-dragging works but mid-scrolling not works, or mid-scrolling works while holding-dragging not works, can't determine why |
I encounter also a problem with 2.6 (Ubuntu 22.04). A simple left click acts as a long press. I have also to rollback to 2.5 and everything works as expected. |
I am also experiencing this issue, is there an easy way to downgrade on Fedora? I tried |
OK, so now I'm on my computer, I tried to reproduce, but I fail. For example, in the settings, I can either scroll or click & drag. Is it "random"? Or 100% reproducible? Could you please give more information:
|
Oh, I understand, in Firefox, I can scroll using middle-scroll, but not by click&drag (because now it behaves like a mouse rather than a finger). This is definitely due to 6808288. So I will need to restore a pointer, but that will cause other problems (for example, mouse hover needs a mouse: #5067). Will need to find something which works for all cases. |
Oh, using a "finger" tool type in all cases seems to be sufficient: diff --git a/server/src/main/java/com/genymobile/scrcpy/control/Controller.java b/server/src/main/java/com/genymobile/scrcpy/control/Controller.java
index 85425113a..a5cda74cf 100644
--- a/server/src/main/java/com/genymobile/scrcpy/control/Controller.java
+++ b/server/src/main/java/com/genymobile/scrcpy/control/Controller.java
@@ -278,14 +278,16 @@ public class Controller implements AsyncProcessor {
pointer.setPressure(pressure);
int source;
+
+ // Always behave like a finger (to scroll a page via Click+drag)
+ pointerProperties[pointerIndex].toolType = MotionEvent.TOOL_TYPE_FINGER;
+
if (pointerId == POINTER_ID_MOUSE) {
// real mouse event
- pointerProperties[pointerIndex].toolType = MotionEvent.TOOL_TYPE_MOUSE;
source = InputDevice.SOURCE_MOUSE;
pointer.setUp(buttons == 0);
} else {
// POINTER_ID_GENERIC_FINGER, POINTER_ID_VIRTUAL_FINGER or real touch from device
- pointerProperties[pointerIndex].toolType = MotionEvent.TOOL_TYPE_FINGER;
source = InputDevice.SOURCE_TOUCHSCREEN;
// Buttons must not be set for touch events
buttons = 0; Please test by replacing this file in the scrcpy v2.6 release folder:
|
@vidoardes you can download the scrcpy-server above and test with: export SCRCPY_SERVER_PATH=/xxx/scrcpy-server # adapt the path
scrcpy |
I can confirm it fixes scrolling in Firefox, but not in all apps. Not sure what the difference is, but one example is a game call Gold & Goblins which doesn't now work (but did in 2.5) |
OK, thank you very much. Now I can reproduce and debug easily 👍 The the trick in #5162 (comment) is not correct: it works only if the input is a |
Even if the pointer is a mouse, inject it as a finger unless it is required to be a mouse, that is: - when it is a HOVER_MOUSE event, or - when a secondary button is pressed. Some apps/games only accept events from a finger/touchscreen, so using a mouse by default does not work for them. For simplicity, make this change on the server side just before event injection (so that the client does not need to know about this hacky behavior). Refs 6808288 Refs c7b1d0e Fixes #5162 <#5162>
Even if the pointer is a mouse, inject it as a finger unless it is required to be a mouse, that is: - when it is a HOVER_MOUSE event, or - when a secondary button is pressed. Some apps/games only accept events from a finger/touchscreen, so using a mouse by default does not work for them. For simplicity, make this change on the server side just before event injection (so that the client does not need to know about this hacky behavior). Refs 6808288 Refs c7b1d0e Fixes #5162 <#5162>
Please test with this change (89288c9):
|
Fixed in scrcpy 2.6.1. |
Even if the pointer is a mouse, inject it as a finger unless it is required to be a mouse, that is: - when it is a HOVER_MOUSE event, or - when a secondary button is pressed. Some apps/games only accept events from a finger/touchscreen, so using a mouse by default does not work for them. For simplicity, make this change on the server side just before event injection (so that the client does not need to know about this hacky behavior). Refs 6808288 Refs c7b1d0e Fixes Genymobile#5162 <Genymobile#5162> Fixes Genymobile#5163 <Genymobile#5163>
as 2.6 said:
By default, a simple click triggers the shortcuts, and Shift+click forwards the click to the device.
I hate this default setting! It makes very inconvenience for control than 2.5. I have to roll-back.
my cli is just "scrcpy -Sw", means I use SDK mouse
The text was updated successfully, but these errors were encountered: