hope this finds you well. I was watching a video on YouTube, I think the channel was Linus tech tips and one of the guys was using something like a hat to check his brain waves or something of that sort and end result is he can share his keyboard and mouse across 3 computers. All he needs to do is look at the computer's screen and his keyboard gets connected to the PC. Now I was wondering can we do that using infrared sensors and raspberry pi?
I have a vague idea of how it may work but I have a few major gaps in my idea. I thought I will use an infrared sender as the hat and attach receivers on every computer screen, every time I look at the screen directly, the sensor will catch the signal and activate a USB port or something which I haven't figured out yet. I can use a raspberry pi to connect all the receiver IR sensors but once I determine which computer I'm looking at how will I forward a keyboard connection to the computer assuming I connect the keyboard to the raspberry pi? Or I can somehow connect the keyboard to 3 computers simultaneously (I will probably just cut the wire and make 2 ends) and get the raspberry pi to activate one USB port at a time once it picks up the IR signal. Any thoughts?