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

how to Disable Right Click to exit #732

Closed
WANASX opened this issue Aug 17, 2019 · 13 comments
Closed

how to Disable Right Click to exit #732

WANASX opened this issue Aug 17, 2019 · 13 comments

Comments

@WANASX
Copy link

WANASX commented Aug 17, 2019

hello !
how to Disable Right Click to exit i need to use right click without close anything

@rom1v
Copy link
Collaborator

rom1v commented Aug 17, 2019

On Android, right click is rarely used. Typically, you get contect menu with long left-click.

That's why in scrcpy right-click is mapped to BACK.

Why do you need right-click?

@WANASX
Copy link
Author

WANASX commented Aug 17, 2019

can i remapped right-click?
i use keyboard mapper app to play pubg mobile in scrcpy but in app i need to use right-click to unlock mouse
in app i cant change map right-click

So i need to change mappedin scrcpy from back to nothing
and thank you

@rom1v
Copy link
Collaborator

rom1v commented Aug 17, 2019

can i remapped right-click?

No, you can't without modifying the source code.

@WANASX
Copy link
Author

WANASX commented Aug 19, 2019

@rom1v please I need a solution

@rom1v
Copy link
Collaborator

rom1v commented Aug 19, 2019

Basically, let right-click being forwarded to the device:

diff --git a/app/src/input_manager.c b/app/src/input_manager.c
index 5258bed..58a1325 100644
--- a/app/src/input_manager.c
+++ b/app/src/input_manager.c
@@ -409,10 +409,6 @@ input_manager_process_mouse_button(struct input_manager *input_manager,
                                    const SDL_MouseButtonEvent *event,
                                    bool control) {
     if (event->type == SDL_MOUSEBUTTONDOWN) {
-        if (control && event->button == SDL_BUTTON_RIGHT) {
-            press_back_or_turn_screen_on(input_manager->controller);
-            return;
-        }
         if (control && event->button == SDL_BUTTON_MIDDLE) {
             action_home(input_manager->controller, ACTION_DOWN | ACTION_UP);
             return;

But in practice, it seems to do the same action as left click in many apps.

@WANASX
Copy link
Author

WANASX commented Aug 20, 2019

I have download scrcpy-master and edit in input_manager.c and change BUTTON RIGHT event to this

input_manager_process_mouse_button(struct input_manager *input_manager,
                                    const SDL_MouseButtonEvent *event,
                                    bool control) {
     if (event->type == SDL_MOUSEBUTTONDOWN) {
-        if (control && event->button == SDL_BUTTON_RIGHT) {
-            press_back_or_turn_screen_on(input_manager->controller);
-            return;
-        }
         if (control && event->button == SDL_BUTTON_MIDDLE) {
             action_home(input_manager->controller, ACTION_DOWN | ACTION_UP);
             return;

but now i dont now how to run it with scrcpy can you help me

@rom1v
Copy link
Collaborator

rom1v commented Aug 20, 2019

and change BUTTON RIGHT event to this

(the - means you need to remove the lines)

but now i dont now how to run it with scrcpy can you help me

Follow BUILD.

@WANASX
Copy link
Author

WANASX commented Aug 20, 2019

yes i remove -
man i try Follow BUILD. But I didn't know anything its hard steps I did not understand how to do it

@WANASX
Copy link
Author

WANASX commented Aug 20, 2019

i use windows 10

@rom1v
Copy link
Collaborator

rom1v commented May 24, 2020

Ref #1302

@richaardvark
Copy link

richaardvark commented Aug 2, 2021

I wish there was some way to disable the right-click and scroll-wheel-click always going back and closing whatever I'm working on. It drives me CRAZY and makes scrcpy almost unusable for me. I guess I have an overly sensitive mouse but I constantly bump the middle mouse scroll-wheel button and then whatever I'm in the middle of doing instantly vanishes or is closed, sometimes to detrimental effect, with my losing data/information/work. I'm about to just take my mouse apart and physically remove the sensors/switches for the right-click and middle mouse scroll-wheel buttons it's driving me so crazy lol. I can't believe there's not a simple override for this feature :(

@rom1v
Copy link
Collaborator

rom1v commented Aug 2, 2021

@rom1v rom1v closed this as completed Aug 2, 2021
@cewatkins
Copy link

cewatkins commented Aug 2, 2021 via email

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