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;
}
A workaround, until android gets fixed, might be to have the app connect to localhost as adb client and issue adb commands.
On the adb shell you can open /dev/input/uevent device to write mouse events include, absolute position