I'm very interested in a similar setup. So far I don't think I've figured out an elegant solution.
My current solution is to have both devices plugged into the monitor, and use a usb hub to share the peripherals, manually moving the cable to the hub between devices.