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 achieve multiply control? #243

Closed
SSSANTON opened this issue Aug 24, 2018 · 4 comments
Closed

How to achieve multiply control? #243

SSSANTON opened this issue Aug 24, 2018 · 4 comments

Comments

@SSSANTON
Copy link

SSSANTON commented Aug 24, 2018

I want to use scrcpy to play a shooting type mobile game in PC.While I finished mapping the controls from SDL2 events to this game(Mainly by modifying the file inputmanager.c). I found out it can't send different events in same time, for example mouse move event will block the key event, key event will break the mouse move event. I need to tap two or more different location points in same time.

So does SDL2 support multiply control and which part of source code should I change to make it support multiply control, just the client or both the client and the server?

@rom1v
Copy link
Collaborator

rom1v commented Aug 24, 2018

I want to use scrcpy to play a shooting type mobile game in PC.

Just for info, did you try the rawkeyevents branch (#87)?

I found out it can't send different events in same time, for example mouse move event will block the key event, key event will break the mouse move event.

Sending an event is instantaneous, so a key event should not block a mouse event and vice versa. For exemple, here is a possible sequence of events:

  • press key Return
  • move mouse to 100,100
  • press mouse button Left
  • release key Return
  • move mouse to 105,102
  • release mouse button Left

I need to tap two or more different location points in same time.

Multitouch is not supported (#59).

which part of source code should I change to make it support multiply control

You need to capture the SDL events (#22 (comment), SDL_TouchFingerEvent, SDL_MultiGestureEvent), modify control_event.h/ControlEvent.java to support a new type of events, then parse (ControlEventReader.java) and handle them (EventController.java) on the server-side.

@SSSANTON
Copy link
Author

SSSANTON commented Aug 24, 2018

@rom1v
Thanks for your explanation and suggestion.
And I don't mean that I want to multiply touch in the screen of my Laptop(It don't have a touch screen too). I just want to simulate multiply touch operation in my phone by sending general events by my keyboard and mouse.

@m4heshd
Copy link

m4heshd commented Feb 12, 2020

Any chance this works by now?

@rom1v
Copy link
Collaborator

rom1v commented Apr 9, 2020

Multitouch has been implemented (#22).

@rom1v rom1v closed this as completed Apr 9, 2020
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

3 participants