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

Forward all clicks by default for UHID and AOA #4877

Closed
wants to merge 1 commit into from
Closed

Conversation

rom1v
Copy link
Collaborator

@rom1v rom1v commented Apr 23, 2024

In relative mouse modes (when the cursor appears on the device), it makes more sense to forward all clicks (disable HOME/BACK shortcuts on secondary clicks).

Transform the boolean option --forward-all-clicks into a 3-state option:

  • --forward-all-clicks=true or --forward-all-clicks: enable
  • --forward-all-clicks=false: disable
  • --forward-all-clicks=auto (default): enable only for UHID and AOA

That way, by default, all clicks are forwarded with scrcpy -M.

Refs #4727 (comment)

@rom1v rom1v mentioned this pull request Apr 23, 2024
2 tasks
@rom1v
Copy link
Collaborator Author

rom1v commented Apr 23, 2024

Or maybe it would be more consistent to keep --forward-all-clicks as a boolean option, and add a new --no-forward-all-clicks:

# SDK mouse: forward all clicks is disabled
scrcpy
# UHID mouse: forward all clicks is enabled
scrcpy -M

# SDK mouse: force enabled
scrcpy --forward-all-clicks
# UHID mouse: force disabled
scrcpy -M --no-forward-all-clicks

What do you think?

@rom1v rom1v force-pushed the window branch 3 times, most recently from be9bf7d to e250628 Compare April 29, 2024 07:29
@rom1v rom1v force-pushed the window branch 3 times, most recently from 14348f4 to 063a833 Compare May 11, 2024 15:13
In relative mouse modes (when the cursor appears on the device), it
makes more sense to forward all clicks (disable HOME/BACK shortcuts on
secondary clicks).

Transform the boolean option --forward-all-clicks into a 3-state option:
 - --forward-all-clicks=true or --forward-all-clicks: enable
 - --forward-all-clicks=false: disable
 - --forward-all-clicks=auto (default): enable only for UHID and AOA

That way, by default, all clicks are forwarded with `scrcpy -M`.

Refs <#4727 (comment)>
PR #4877 <#4877>
@rom1v rom1v changed the base branch from window to dev June 23, 2024 17:30
@rom1v rom1v force-pushed the forward_all_clicks branch from 65bdc38 to e3edb52 Compare June 23, 2024 17:30
@rom1v
Copy link
Collaborator Author

rom1v commented Jun 23, 2024

As an alternative, I think --forward-all-clicks could be deprecated.

It could be replaced by a new parameter --mouse-bind=xxxx. The argument would be exactly 4 characters, one for each secondary click:

--mouse-bind=xxxx
             ^^^^
             ||||
             ||| `- 5th click
             || `-- 4th click
             | `--- middle click
              `---- right click

The characters could be:

  • +: forward the click
  • -: disable the click
  • b: trigger shortcut BACK
  • h: trigger shortcut HOME
  • s: trigger shortcut APP_SWITCH
  • n: trigger shortcut "expand notification panel"

For example:

  • --mouse-bind=bhsn (the default mode with SDK mouse)
  • --mouse-bind=++++ forwards all clicks (would be the default mode in HID/AOA)
  • --mouse-bind=++bh forwards middle and right click, and use 4th button for BACK and 5th button for HOME

This would provide a solution for #2258 (comment).

What do you think?

@123SONIC321
Copy link

@rom1v
It's perfect 👌

@rom1v
Copy link
Collaborator Author

rom1v commented Jun 24, 2024

Superseded by #5022.

@rom1v rom1v closed this Jun 24, 2024
@rom1v
Copy link
Collaborator Author

rom1v commented Jun 24, 2024

@123SONIC321 Implemented by #5022 🚀 Please test 😉

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

Successfully merging this pull request may close these issues.

2 participants