Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 使用python模拟HID设备的鼠标移动_Python 3.x_Raspberry Pi_Mouseevent - Fatal编程技术网

Python 3.x 使用python模拟HID设备的鼠标移动

Python 3.x 使用python模拟HID设备的鼠标移动,python-3.x,raspberry-pi,mouseevent,Python 3.x,Raspberry Pi,Mouseevent,我正在尝试使用PiZero w作为HID设备来模拟鼠标移动。我已经用pi模拟了键盘笔划,并且成功地运行了将按键发送到pi所连接的主机的代码。然而,我不明白如何模拟鼠标的移动,特别是当涉及到python3时 我通过以下网站模拟击键: 我使用: def write_report(report): with open('/dev/hidg0', 'rb+') as fd: fd.write(report.encode()) 将字节从pi发送到主机 是否有任何网站详细介绍了如何

我正在尝试使用PiZero w作为HID设备来模拟鼠标移动。我已经用pi模拟了键盘笔划,并且成功地运行了将按键发送到pi所连接的主机的代码。然而,我不明白如何模拟鼠标的移动,特别是当涉及到python3时

我通过以下网站模拟击键:

我使用:

def write_report(report):
    with open('/dev/hidg0', 'rb+') as fd:
        fd.write(report.encode())
将字节从pi发送到主机


是否有任何网站详细介绍了如何模拟鼠标移动,如上面的链接,或者是否有一个特定的字节可以通过pi发送到以模拟鼠标点击/移动?

我在这里列出了一些资源,但尚未破解此雪人在这里列出了一些资源,但尚未破解此问题