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

Disable shortcuts, especially mouse's shortcuts #1302

Closed
1 task done
phootip opened this issue Apr 19, 2020 · 10 comments
Closed
1 task done

Disable shortcuts, especially mouse's shortcuts #1302

phootip opened this issue Apr 19, 2020 · 10 comments

Comments

@phootip
Copy link

phootip commented Apr 19, 2020

  • I have checked that a similar feature request does not already exist.

Is your feature request related to a problem? Please describe.
I can't play a game (mindustry) without remapping button

Describe the solution you'd like
Disable shortcuts, especially for mouse, so that right-clicking does correct things in-game.

Describe alternatives you've considered
The game supports remapping buttons, but I feel like disable shortcuts should be useful in other games, too.

Additional context
Here is the mindustry github

Also, I think this feature might not be that hard, I've never used adb, but if you're too busy could you guide me? I might be able to have a look, learn them, and create a PR for this. Thank you!

@rom1v
Copy link
Collaborator

rom1v commented Apr 19, 2020

Another reason to forward right-click: #898 (comment)

@rom1v
Copy link
Collaborator

rom1v commented Sep 15, 2020

#712 (comment)

@rom1v
Copy link
Collaborator

rom1v commented Sep 15, 2020

I suggest adding the following options:

  • --right-click=XXX
  • --middle-click=XXX

with XXX either:

  • inject (inject right-click)
  • home
  • back
  • switch_app

I'm a bit annoyed because by default, right-click injects BACK if screen is on, but POWER if screen is off. I don't know how to expose this feature with the configuration.

Should I make it possible for any configuration? Even for middle key? With an explicit configuration (back_or_power, back+, back?, back#, home_or_power…)? Any idea?

@xcjs
Copy link

xcjs commented Sep 15, 2020

@rom1v I don't like the idea of Home being an option as Android maps the Home button already. Ideally I'd like scrcpy to simply passthrough keyboard and mouse events as if they were bluetooth devices connected directly to the device.

You might be able to do additional remapping through Android itself and applications like External Keyboard Helper.

Regarding your word choice, I'd prefer "passthrough" to "inject".

Edit: Nevermind - you want "home" to navigate to home, not bind to the key. I'm fine with providing more options if the author is.

@rom1v
Copy link
Collaborator

rom1v commented Sep 15, 2020

I don't like the idea of Home being an option as Android maps the Home button already.

But it's convenient to have it accessible from the mouse (less than right-click for BACK, but still). Currently, right-click is mapped to BACK and middle-click to HOME.

Ideally I'd like scrcpy to simply passthrough keyboard and mouse events as if they were bluetooth devices connected directly to the device.

The goal of the option I'd like to add is to forward right and middle clicks to the device. (Unfortunately, event injection does not behave as a bluetooth device though, it's not at the same level.)

Regarding your word choice, I'd prefer "passthrough" to "inject".

👍 (what about "forward"?)

If right-click is forwarded, do you think it should still power on the device if it is off?

@rom1v
Copy link
Collaborator

rom1v commented Sep 15, 2020

Or maybe we could keep things simple: --no-mouse-shortcuts (to forward all mouse buttons to the device)

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>
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 on a separate branch (forward_all_clicks):

scrcpy --forward-all-clicks

Could you please test it?

For windows users, take both scrcpy.exe and scrcpy-server, and replace them in your scrcpy v1.16 release.

For other platforms, take scrcpy-server and build only the client.

  • scrcpy.exe
    SHA256: 50d2cc8ef996dcc6cc5447b1cecabaf4d66587ee6217a95198a19a2b439118c6
  • scrcpy-server
    SHA256: 15c69bd3b0c16ddb525d6f9b4217a40ec5b9f27fdfd4ae1e32a4c1584d730909

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
@iamnotoo
Copy link

iamnotoo commented Apr 22, 2024

I've just implemented an option on a separate branch (forward_all_clicks):

scrcpy --forward-all-clicks

Could you please test it?

For windows users, take both scrcpy.exe and scrcpy-server, and replace them in your scrcpy v1.16 release.

For other platforms, take scrcpy-server and build only the client.

  • scrcpy.exe
    SHA256: 50d2cc8ef996dcc6cc5447b1cecabaf4d66587ee6217a95198a19a2b439118c6
  • scrcpy-server
    SHA256: 15c69bd3b0c16ddb525d6f9b4217a40ec5b9f27fdfd4ae1e32a4c1584d730909

it don't work on otg mode, srry about my english i'm brasilian and still learning

@rom1v
Copy link
Collaborator

rom1v commented Apr 22, 2024

In OTG mode, all clicks are always forwarded.

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

No branches or pull requests

4 participants