Set mouse position in software

后端 未结 2 794
感动是毒
感动是毒 2021-02-14 09:42

I am using an Android Stick (http://www.geekbuying.com/item/Uhost-2-Dual-Core-TV-Box-Mini-PC-Android-4-0-4-RK3066-Cortex-A9-1-6GHZ-1GB-RAM-4G-ROM-with-Bluetooth-WIFI-Skype-XBMC-

2条回答
  •  庸人自扰
    2021-02-14 10:31

    Mouse event is managed by the system framework. You cannot control it on Java side.

    On the adb shell you can open /dev/input/uevent device to write mouse events include

    1. relative movement
    2. click action
    3. absolute position (you might want this)

    However, you cannot do it as a normal application, unless you do it on a rooted device, or you can use adb shell to start a daemon service in the background to perform the event writing for your application.

提交回复
热议问题