I currently do this for my triple monitor setup. I hate that in a traditional setup, windows/dialogs open wherever the hell they want, ex: a search dialog for a program might end up on the other monitor instead of the one you're working on. And it changes based on application. So to remedy that my main system is actually single monitor and the two side monitors are raspbery PIs. I then use Synergy to move the mouse across.
Downside is that Synergy crashes ALL THE FREAKING TIME. I'm constantly having to kill -9 it and restart it. When it crashes, the process does not terminate it just stays stuck. So it would be hard to write a watchdog script to just restart it, because there is no real easy way to detect if it crashed. I've been wanting to pour through the source so I can strip out the relevant parts and rewrite my own version that does not crash but have not had a chance.
Once I'm more versed in electronics I really want to look into making a hardware solution. What I have in mind is something that is sorta like a KVM, except each USB out port going to the PCs acts as a mouse and keyboard so each PC always sees a mouse and keyboard plugged in. You plug a mouse and keyboard into the device, and depending on which PC is selected it just"routes" the movement to the respective port. But at any given time, all PCs see a mouse and keyboard attached. A KVM on the other hand actually logically connects/disconnects the mouse/keyboard, so that's why they are so slow. There would also be some software so it can detect that cursor is at the screen edge, but it would also be made to work without the software if you hit the button manually. I researched this briefly and using certain micro controllers and reading up on USB protocol I think it would be doable. There are probably some premade mouse and keyboard controller ICs out there too, I would maybe cheat and use those.