Sharing keyboard/mouse via software with another computer?
I'm not sure if it will fit this specific use case but if you can forego the shared monitor, you can use a tool like Synergy or Share Mouse. 

FWIW, I've used Synergy before across 3 computers and it worked well.