我希望遵循本教程: https://randomnerdtutorials.com/raspberry-pi-zero-usb-keyboard-hid/
最后,Python能够通过USB发送编码数据。我应该使用node.js或某些库的等效项吗?
我希望“翻译”到节点的python函数:
def write_report(report):
with open('/dev/hidg0', 'rb+') as fd:
fd.write(report.encode())
其中hidg0
实际上是另一台PC,并且此代码将在模拟HID设备(RPi)的设备上运行。
在此先感谢您提供所有帮助!