Kind of related to this.
On a rooted Android phone, how do I set the position of the mouse from within an app. (The mouse is a bluetooth mouse.)
The other question mentioned it's possible with root or ADB, but not how.
You can use this library to inject events: https://github.com/radhoo/android-event-injector
And add mouse move event method in Events.java
, below is a example to send a relative mouse move event:
public int sendMouseMove(int deltaX, int deltaY) {
intSendEvent(m_nId, EV_REL, REL_X, deltaX);
intSendEvent(m_nId, 0, 0, 0);
intSendEvent(m_nId, EV_REL, REL_Y, deltaY);
intSendEvent(m_nId, 0, 0, 0);
return 0;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With