I was looking for something similar where I could easily switch multiple displays between my work Mac that uses a dock and my personal gaming PC. I thought that would be the solution, and it almost was. Unfortunately, it didn't quite work. There were issues with USB on one input (PC) and the display was correctly showing full 4k on the other (Mac). I tried different combinations, different cables, but unfortunately nothing changed. So while I was hoping to find the perfect solution for my specific needs, I expect my search will continue.
π HDMI 2.0 4 Port KVM Switch with 4K@60Hz, 2K@144Hz,1080P@120Hz Support, 18Gbps Bandwidth, USB 2.0 Keyboard/Mouse/Printer/Monitor/PC Selector, Audio Out/Mic In, HDR10, Dolby Vision, Dolby/DTS, HDCP2.2 Compatibility
10 Review
π TRENDnet TK-803R: 8-Port Rack Mount KVM Switch with VGA & USB Connection, USB/PS2 Support, Device Monitoring, Auto Scan - Control 8 Computers/Servers
10 Review
CKL Quad Monitor HDMI KVM Switch 4 Port 4K@30Hz with Cables - Extended and Mirrored Display Support for Windows, Linux, and Mac
11 Review
TESmart 1080P 60Hz USB VGA KVM Extender Over Cat5e Cat6 Ethernet Cable - Long Range 984ft/300m (Sender+Receiver)
10 Review