- Most monitors have multiple digital inputs. Connect each computer to one of them
- Use a USB switch keyboard and mouse
- Before switching the USB switch, press the "lock screen" key combination and make sure locking the screen drops the video signal
- After switching the USB switch, pressing shift should bring up the login dialog and re-activate video output. Since the monitor has just lost the signal in the previous step, it will scan the inputs and switch to the desired signal.
I've used it with Windows 10, MacOS and an RPi, with no issues.