
40 Lines of Python to Fake a Serial Mouse
During the COVID lockdowns my son and I started playing The Settlers II in DOSBox. One of the coolest features of the game is that two players can play on the same computer in split screen, each controlling their own cursor — a surprisingly social multiplayer mode for a 1996 strategy game. The trick is that the second player uses a serial mouse. Unfortunately modern operating systems don't really expose the concept of multiple independent mice anymore — they all get merged into a single pointer. So if I wanted that old-school multiplayer experience back, I needed an adapter. My first thought was simple: maybe I can fake a serial mouse? In Unix systems everything is a file . If DOSBox expects a serial device, perhaps I can generate the right byte stream and feed it to it? Reading through the Linux docs and trying to hexdump the mouse device I realized I need to convert from PS/2 mouse protocol into Microsoft serial mouse protocol. The descriptions of both I quickly found on the Internet
Continue reading on Dev.to Tutorial
Opens in a new tab



