Closed paour closed 3 years ago
Pinch zooming with a touchscreen also doesn't work.
Pinch zooming support would be a great idea! Ctrl+← and Ctrl+→ could be used since ↓↑ are taken by volume control. Would be great for people with low/no motor ability in their hands. (I can't move from the shoulders down and greatly appreciate what you've done with scrcpy)
It would be great to have the ability to pinch zoom. Another alternative could be using the mouse wheel.
Scrcpy is really great!
Would be great if this can be added!
another vote for this feature
+1! Scrcpy is awesome and this is the only feature missing for me!
Oeh i see some references to this pr, but i cannot find if this is implemented... Any idea?
Hi, I just implemented an experimentation, on branch virtualfinger
.
While the Ctrl key is held, the first left-click adds an immobile "virtual finger" at this position.
Moving the mouse moves another cursor. The left click may be released and pressed as necessary to control the second finger.
Releasing Ctrl releases the virtual finger.
A simpler (and maybe more intuitive) alternative could be to always put the "virtual finger" in the center of the screen, so that "unzooming" is more natural.
As a drawback, it would not be possible to zoom on a widget which takes only a portion of the screen (which is not in the center), but it may be worth it.
OK cool, so what do we have to do to try this virtualfinger? Upgrade anything? I'm on a Mac
Literally amazing, this fixes issue https://github.com/srevinsaju/guiscrcpy/issues/2 on guiscrcpy as well
@rom1v I am having problems with the virtualfinger branch,
INFO: scrcpy 1.10 <https://github.com/Genymobile/scrcpy>
/usr/local/share/scrcpy/scrcpy-server.jar: 1 file pushed. 1.1 MB/s (22546 bytes in 0.019s)
INFO: Initial texture: 720x1280
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] WARN: Unknown event type: -1
[server] ERROR: Exception on thread Thread[Thread-1,5,main]
java.lang.IllegalStateException: Buffer full, call next() to consume
at com.genymobile.scrcpy.ControlMessageReader.readFrom(ControlMessageReader.java:35)
at com.genymobile.scrcpy.DesktopConnection.receiveControlMessage(DesktopConnection.java:110)
at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:82)
at com.genymobile.scrcpy.Controller.control(Controller.java:73)
at com.genymobile.scrcpy.Server$1.run(Server.java:45)
at java.lang.Thread.run(Thread.java:764)
Is it due to some installation problem, or some unhandled exception. Running Ubuntu 19.04 scrcpy v1.10 virtualfinger branch. The mirroring and screen shots continue to work, but the mouse events are not passed not even single and normal click passed.
Sent from my Galaxy Note2 using FastHub
You need to recompile the server too.
Thanks, will check that way
@rom1v, no hope, the same error again
What I did
meson x --buildtype release --strip -Db_lto=true
cd x
ninja
cd app
./scrcpy
Unfortunately, the same error comes up. Can't pass clicks as well
Sent from my Galaxy Note2 using FastHub
Hi, i have used the branch virtualfinger, that allowed me to simulate pinch-zoom. However that branch is falling behind compared to the master, any idea if you would implement this in the master ?
The problem is that it is not really usable without a visual feedback (to display which locations are actually clicked), and it requires some work do implement it. So I probably won't merge it without that. :disappointed:
ah, that is to bad. scrcpy is really great and the one feature missing for me is the ability to send a pinch command. is it much to work bind for example ctrl + and ctrl - to send a simulated pinch ?
The problem is that it is not really usable without a visual feedback (to display which locations are actually clicked)
would it be possible to hook into the same touch events that the os shows for finger inputs? For example I have the developer option "show touch location" turned on. This works for my finger but not when I click with scrcpy, can scrcpy "use" that same method of tapping the ui that would produce these visual aids people could just turn on in dev options?
Im guessing not
+1 definitely a great feature
i cant wait for this feature, for gaming this will be very helpful
I'm still waiting for day by day this feature released. It's really helpful for any app/game need Zoom in/out by mouse. Any update so far for this great feature?
Pinch zooming seems to be the only input feature missing from scrcpy. Hopefully it gets implemented because this is very nice software.
Hi,
I finally worked on this feature today.
The problem with my previous attempts is that I wanted to be able to zoom from any point (not only the center of the screen), but it's a UX nightmare. Therefore, I took the same approach as the Android emulator, and just scale/rotate relative to the center of the screen. That way, it's easy to zoom/unzoom.
Just hold Ctrl
when you lelf-click to enable pinch-to-zoom (it is disabled when left-click is released). (I used Ctrl
because that's what the Android emulator does.)
The branch is pinch_zoom
.
Here is a Windows binary to test (replace in your v1.15.1 release):
scrcpy.exe
SHA256: 1b38173837da14e5b134582ba75aa38e166903aaa592cb0b8b10d6ba8a1e61ceImplemented in v1.16.
Anyone else experiencing problem with pinch-zooming maps? Currently experienced in both Google Maps and OSMand. I seem to not be able to zoom out or in very much because at a certain point the action turns into its opposite, sometimes with the map rotating around itself a full round. One must hold the mouse pointer at the very pinpoint accurate point where the pointer originally was pressed to be able to keep zooming out or in to farther lengths without turning the map around and/or reversing the zoom operation. For short-step zoom actions there is no such problem so long-step zooming can be achieved only via several, consecutive short-step zooming.
Currently experienced in both Google Maps and OSMand. I seem to not be able to zoom out or in very much because at a certain point the action turns into its opposite, sometimes with the map rotating around itself a full round.
To zoom out, you need to start at the edges (top, bottom, left or right) and moves towards the center.
Imagine that this mode adds a finger inverted through the center:
(This is a capture from Android emulator, unfortunately scrcpy does not provide any visual feedback, hence the confusion.)
Would you reconsider to reverse the mouse drag directions actions ? i.e to make pulling the mouse towards me zoom out and pulling away from me zoom in ? or maybe the app would need at some point an INI-style configuration file for to reconfigure all the keys.
i.e to make pulling the mouse towards me zoom out and pulling away from me zoom in ?
What do you mean by "pulling towards" or "pulling away"? The screen is 2D and you are in another dimension :smile:
Would you reconsider to reverse the mouse drag directions actions ?
In fact, this feature does not implement "zoom in/out", nor choose any drag direction, it just injects additional touch events at a location inverted through the center of the screen. Then the Android app normally reacts to the touch events from the mouse and the virtual finger.
Good afternoon. I think the issue is not the zoom of the screen. And yes, simulate the pinch movement. An easy way would be: When pressing a key (alt), two fingers are pressed, pressing the screen from a distance "R" from the mouse position captured with (x, y). And depending on the scroll of the mouse, these fingers move apart or get closer to the mouse position. I think the ideal would be diagonally as some photo editors stretch vertically or horizontally. And diagonally this would maintain the proportion. So you pass the responsibility to the application. If he has zomm the app interacts with the fake fingers. Otherwise the application does nothing. I think it would not be difficult to simulate the pinch and not the zoom, leave that to the application that is running. It probably won't work for all cases, but I think it would be a solution for most.
@edulourenzo Isn't more or less what is implemented in v1.16? (except it does not use the mouse scroll)
And what would be the command to make the zoom pinch movement
Ctrl+click-and-move.
More details: https://github.com/Genymobile/scrcpy/releases/tag/v1.16
AWESOME! been waiting for this feature for a long time, i love scrcpy but it always lacked that one major feature, thanks alot to all developers, you are doing a terrific job!
no longer working?\ i'm on linux\ android 10
Yes, it is working: https://github.com/Genymobile/scrcpy#pinch-to-zoom
Which version of scrcpy do you use?
i use
$ scrcpy --version
scrcpy 1.12.1
dependencies:
- SDL 2.0.10
- libavcodec 58.54.100
- libavformat 58.29.100
- libavutil 56.31.100
i rebuild scrcpy from source code and it suddenly worked :confused:
scrcpy 1.12.1
It's a very old version, pinch zoom has been implemented in 1.16.
i installed it with apt install scrcpy
.\
anyways thank you
The Android emulator uses right click and drag to simulate pinch zooming. An alternative would be ctrl-mouse wheel.