Skip to content
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

Long Press as right click #1613

Closed
MichaelD45 opened this issue Jul 21, 2020 · 11 comments
Closed

Long Press as right click #1613

MichaelD45 opened this issue Jul 21, 2020 · 11 comments

Comments

@MichaelD45
Copy link

I'm controlling the google chrome remote desktop app on a galaxy note 4 running android 6 using scrcpy 1.14. The remote desktop app on android mimicks a right click via a long press. The long press causes a rectangle to appear and on release the right click context menu on the remote computer becomes visible. When using scrcpy with mouse or touchpad a long click does not result in the rectangle and there doesn't seem to be a way for scrcpy to send the long press to the android phone that will make the google chrome remote desktop app display the windows right click context menu?

@MichaelD45
Copy link
Author

Oh and thanks for making scrcpy!

@rom1v
Copy link
Collaborator

rom1v commented Jul 21, 2020

Does long press work in other contexts (outside of this app)? (for example, long press on a text in your browser, it should select a word... or any other long press action in other contexts)

@MichaelD45
Copy link
Author

Thanks for coming back. Yes. Long press works fine on a browser. Tried it on a word in the chrome browser on the phone as controlled by Scrcpy and a full word was selected fine. As a further test I connected a bluetooth mouse to my phone directly and tried a long press in the chrome remote desktop app . It presented the same problem - the long mouse left press did not generate the right click menu. I do get the right click menu in chrome remote desktop on the phone if I long press on the phone with my finger. Also checked with the s-pen and a long press will also open the right click context menu. So seems there is maybe a difference between a mouse long click and a finger long press in general? So I suppose this means to control chrome remote desktop on the phone with a mouse there needs to be a way for the mouse to mimick some subtelty of a long finger press which is signalled maybe slightly differently to holding down the left mouse button.

@MichaelD45
Copy link
Author

MichaelD45 commented Jul 21, 2020 via email

@xcjs
Copy link

xcjs commented Sep 15, 2020

I just wanted to leave a comment here discussing the way scrcpy handles the mouse and keyboard.

Android does have built in mouse support, and while few in number, there are Android applications that do properly support mouse events, complete with a right-click. The way scrcpy handles right-click now breaks these applications when trying to use them normally.

Typically Android maps "Esc" as back in its native keyboard support, and I would really prefer if scrcpy mapped keyboard and mouse events properly as if the keyboard and mouse were connected directly to the Android device itself.

I do realize special mappings may need to be required (pinch to zoom for example, which was an amazing addition), and I'm fine with that as long as it doesn't conflict with standard Android input events.

@rom1v
Copy link
Collaborator

rom1v commented Sep 15, 2020

@xcjs #1302

@rom1v
Copy link
Collaborator

rom1v commented Sep 15, 2020

@xcjs #1302 (comment) any opinion?

rom1v added a commit that referenced this issue Oct 5, 2020
Add --forward-all-clicks to disable mouse shortcuts and forward middle
and right clicks to the device instead.

Fixes #1302 <#1302>
Fixes #1613 <#1613>
@rom1v
Copy link
Collaborator

rom1v commented Oct 5, 2020

I've just implemented an option: #1302 (comment)

Could you please test it?

rom1v added a commit that referenced this issue Nov 3, 2020
Add --forward-all-clicks to disable mouse shortcuts and forward middle
and right clicks to the device instead.

Fixes #1302 <#1302>
Fixes #1613 <#1613>
@rom1v
Copy link
Collaborator

rom1v commented Nov 3, 2020

Merged into dev: adc547f.

@rom1v rom1v closed this as completed Nov 3, 2020
jellopuddingstick added a commit to jellopuddingstick/scrcpy that referenced this issue Jan 23, 2021
scrcpy v1.17

Changes since v1.16:
 - Fix errors on Android 11 (Genymobile#1468)
 - Add --encoder option (Genymobile#1810, Genymobile#1827)
 - Add --forward-all-clicks option (Genymobile#1302, Genymobile#1613)
 - Add --legacy-paste option (Genymobile#1750, Genymobile#1771)
 - Workaround screen off/on issue on exit (Genymobile#1670)
 - Rework console/noconsole versions on Windows (Genymobile#1875, Genymobile#1988)
 - Terminate server properly without killing it on close (Genymobile#1992)
 - List available shortcut keys on error (Genymobile#1681)
 - Upgrade platform-tools to 30.0.5 (adb) in Windows releases
 - Upgrade SDL to 2.0.14 in Windows releases
@luke-jr
Copy link

luke-jr commented Aug 29, 2021

Many apps don't work with a literal forwarded right-click action. Would it be possible to have actually simulating the longpress be an option? I wonder if it could be as simple as "backdating" the downTime parameter to MotionEvent.obtain...

@DanEdens
Copy link

DanEdens commented May 3, 2023

I actually love scrcpy because it does exactly that.. toggle option please if you change it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants