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

Get pointer absolute position #5516

Open
BHznJNs opened this issue Nov 23, 2024 · 2 comments
Open

Get pointer absolute position #5516

BHznJNs opened this issue Nov 23, 2024 · 2 comments

Comments

@BHznJNs
Copy link

BHznJNs commented Nov 23, 2024

I am trying to add a new function for the scrcpy-server, to get the absolute position of pointer.

I tried some ways:

  • getevent: with getevent command, i can only get the relative movement of cursor
    • i also tried to calculate the absolute position by relative movement integral, but there is always some error so i think this approach might not be feasible.
  • startActivityAsUser: i noticed that the scrcpy.wrappers.ActivityManager has a method startActivity, which calls the startActivityAsUser method. I tried to use it to create an activity from an activity class or a package name, but it seems i has no permission to do so.

Would there be any way to implement that? Thank you so much!

@BHznJNs
Copy link
Author

BHznJNs commented Nov 24, 2024

Maybe i found a possible way: change the HID_MOUSE_REPORT_DESC so that i can send the absolute position of mouse to server to move mouse

@BHznJNs
Copy link
Author

BHznJNs commented Nov 24, 2024

After some trial, the way to change the HID_MOUSE_REPORT_DESC seems not work.
I do not sure if the HID report decription is wrong or the HID input data writing is wrong, and
I also searched a forum posts that says, the android does not support the absolute positioning HID mouse

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

No branches or pull requests

1 participant