简体   繁体   English

在root用户设备上设置鼠标位置

[英]set mouse position on rooted android device

Kind of related to this . 相关的那种。

On a rooted Android phone, how do I set the position of the mouse from within an app. 在有根的Android手机上,如何在应用程序中设置鼠标的位置。 (The mouse is a bluetooth mouse.) (鼠标是蓝牙鼠标。)

The other question mentioned it's possible with root or ADB, but not how. 另一个问题提到它可能是root或ADB,但不是如何。

You can use this library to inject events: https://github.com/radhoo/android-event-injector 您可以使用此库来注入事件: 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: 并在Events.java添加鼠标移动事件方法,下面是一个发送相对鼠标移动事件的示例:

    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. 解决方法,直到android得到修复,可能是让应用程序连接到localhost作为adb客户端并发出adb命令。

On the adb shell you can open /dev/input/uevent device to write mouse events include, absolute position 在adb shell上你可以打开/ dev / input / uevent设备写入鼠标事件包括,绝对位置

Set mouse position in software 在软件中设置鼠标位置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在已root用户的Android设备中复制系统文件 - Copy system files in rooted android device 更改root设备上的日期(Android M) - Change date on rooted device (Android M) 如何以编程方式在Android植根设备中将.raw文件转换为图像文件 - How to convert .raw file to image file in android rooted device programmatically 如何在Rooted android设备中使用shell命令读取SMS? - How to read the SMS using shell commands In Rooted android Device? 以编程方式在Android设备上创建Google帐户(非root用户设备) - Creating a google account on android programatically (non-rooted device) 如何通过 appium 或 adb 更改 root android 设备的 IMEI 号码? - How to change the IMEI number of a rooted android device via appium or adb? 在根目录下的Android设备中访问和操作外部USB存储设备上的文件和目录 - Access and manipulate files and directories on an external USB storage in a rooted Android device Android:检索其他应用程序(root设备)的共享首选项 - Android: Retrieving shared preferences of other application (rooted device) Libgdx在Android中获取鼠标位置 - Libgdx getting mouse position in android 通过Google TV(Android非根设备)从端口查找pid - find pid from port over Google TV (Android non-rooted device)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM