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

Can I use the repo to send events to scrcpy server on Android from a recorded getevent ? #12

Closed
instasck opened this issue Dec 3, 2021 · 6 comments
Labels
question Further information is requested

Comments

@instasck
Copy link

instasck commented Dec 3, 2021

I have the following recorded scroll:

[  116385.268385] 0003 0039 000002c5
[  116385.268385] 0003 0030 00000008
[  116385.268385] 0003 0035 00000186 -  x
[  116385.268385] 0003 0036 0000029c  - y
[  116385.268385] 0001 014a 00000001  -- finger down
[  116385.268385] 0000 0000 00000000
[  116385.300193] 0003 0035 00000185
[  116385.300193] 0003 0036 000002b0
[  116385.300193] 0000 0000 00000000
[  116385.310616] 0003 0035 00000184
[  116385.310616] 0003 0036 000002d1
[  116385.310616] 0000 0000 00000000
[  116385.321030] 0003 0035 00000183
[  116385.321030] 0003 0036 0000030b
[  116385.321030] 0000 0000 00000000
[  116385.331669] 0003 0030 00000007
[  116385.331669] 0003 0035 00000180
[  116385.331669] 0003 0036 000003a1
[  116385.331669] 0000 0000 00000000
[  116385.342048] 0003 0030 00000006
[  116385.342048] 0003 0035 0000017f
[  116385.342048] 0003 0036 000003c9
[  116385.342048] 0000 0000 00000000
[  116385.352433] 0003 0036 000003f1
[  116385.352433] 0000 0000 00000000
[  116385.363175] 0003 0030 00000005
[  116385.363175] 0003 0035 00000180
[  116385.363175] 0003 0036 0000041c
[  116385.363175] 0000 0000 00000000
[  116385.383405] 0003 0039 ffffffff
[  116385.383405] 0001 014a 00000000  -- finger up
[  116385.383405] 0000 0000 00000000

I want to replay it using scrcpy, can it be done ?

@instasck instasck changed the title Can I use the repo to send events to scrcpy server on Android without init the video stream ? Can I use the repo to send events to scrcpy server on Android from a recorded getevent ? Dec 3, 2021
@leng-yue
Copy link
Owner

leng-yue commented Dec 4, 2021

Of course, you can send this series of events. However, scrolling events on android itself is not reproducible.

@leng-yue leng-yue added the question Further information is requested label Dec 4, 2021
@instasck
Copy link
Author

instasck commented Dec 4, 2021

scrolling

I see you have the "swipe" option, it is not different from scroll I guess I meant swipe.
I need someone to do a job for me, so please tell me if you know anyone:
I need to send the events as recorded in getevents.
I need to change the device ID used in the motion event over scrcpy (to be sent from the client side)

@leng-yue
Copy link
Owner

leng-yue commented Dec 4, 2021

What's the format of your recorded scroll? To begin with, you need to parse it. Then, you can use scrcpy-client to construct events and dispatch them manually.

@leng-yue
Copy link
Owner

leng-yue commented Dec 4, 2021

Please refer to the getevent's document https://source.android.com/devices/input/getevent. However, it is hard to use scrcpy to dispatch all kinds of native android events, you can consider ADB's sendevent instead.

@leng-yue leng-yue closed this as completed Dec 4, 2021
@instasck
Copy link
Author

instasck commented Dec 5, 2021

Please refer to the getevent's document https://source.android.com/devices/input/getevent. However, it is hard to use scrcpy to dispatch all kinds of native android events, you can consider ADB's sendevent instead.

The issue is that android 10 locked it access to sendevent, I am looking for a solution to that.
What will be the different from scrcpy to real touch screen since I know it send the ACTION_DOWN, MOVE, ACTION_UP what the software we controll over in android will see different ? I know touch id is one of them

@leng-yue
Copy link
Owner

leng-yue commented Dec 5, 2021

There are so many differences... You will find that scrcpy has much fewer operations than the sendevent.

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

No branches or pull requests

2 participants