I use "Input Director", a software KVM switch which is free and primarilly for Windows use. Basically my main computer is the Master and set on its own internal LAN IP, the laptop and/or any other machine has its own LAN IP and is set as a Slave. These are named in Windows so I have Main-PC, Steve-PC, Lappy-PC etc. I move my mouse seamlessly from main computer left monitor to right monitor, to Laptop and back. I can set it to come back from the left or the right or both. I can use the same keyboard/mouse to operate all of them.
I`ve never tried to get it working on the Pi and not sure if it supports Linux. but another similar, untried version, called Synergy puports to work on Linux too. Not so strange because I have my Android Phone set so I can move my cursor to that too. Both programs are free, worth a dabble and maybe get one working with the RasPi.......