简体   繁体   English

Raspberry Pi键盘分离器

[英]Raspberry Pi Keyboard Splitter

I would like to program a Raspberry Pi to take a single keyboards inputs in one USB port and then output through the Pi's two other USB ports in order to control two Macs at once with one keyboard. 我想编写一个Raspberry Pi来在一个USB端口中输入一个键盘输入,然后通过Pi的另外两个USB端口输出,以便用一个键盘一次控制两个Mac。

I'm very new to Python. 我是Python的新手。 Which functions and commands do I need in order to program this function to my Pi? 为了将此功能编程到我的Pi,我需要哪些功能和命令?

I've been searching for the proper command, but I came here for help. 我一直在寻找合适的命令,但我来到这里寻求帮助。

This isn't exactly something easily done with Python. 这不是用Python轻松完成的事情。 This is because you're delving into developing device drivers on your Macs' side. 这是因为您正在深入研究Mac上的设备驱动程序。 Please allow me to explain: 请允许我解释一下:

Assuming you're using Raspbian on the Raspberry Pi (a flavor of Linux, and thus a Posix system onto itself), you would need to read the appropriate /dev/tty* file which maps to your keyboard first , and then appropriately convert and write out to the appropriate /dev/usb* files. 假设你在树莓派(一个Linux的味道,因此POSIX的系统上本身)使用Raspbian,你需要阅读相应/dev/tty*映射到键盘第一个文件,然后适当地转换和写出相应的/dev/usb*文件。 Do note, most computers also send handshakes back and forth to the USB devices (for example, to register them on their own USB busses). 请注意,大多数计算机还会向USB设备发送握手 (例如,将它们注册到自己的USB总线上)。

To be frank, you'd probably have better luck splicing wires from your keyboard, and connecting it to another USB male-socket, and then plugging both male-socket ends into your Macs. 坦率地说,你可能有更好的运气从键盘上拼接电线,并将其连接到另一个USB公插座,然后将两个公插座端插入你的Mac。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM