Logitech makes a keyboard and mouse that connects to 3 computers at once.
I just set this up for someone who has 2 Windows Laptops and a Macbook...all for work.
Here's the keyboard
https://www.amazon.com/Logitech-Multi-Device-Wireless-Keyboard-Computer/dp/B01LZTBKBG/
Here's the mouse
https://www.amazon.com/Logitech-Triathlon-Bluetooth-Hyper-Fast-Scrolling/dp/B087Z6LSHW/
There's also a software solution called Synergy
https://symless.com/synergy