maybe Troed Sångberg (npub14zw…pf4e) can build one for you. Forgot the name. Basicaly a hardware based automatic KVM.
Originally a device which seamlessly switches computers when the mouse gets to the border, thus extending to 2 screens but on 2 different computers.
As it's raspberry based it can be reprogrammed to do whatever you want.