I use a monitor for this.
Just hit a button the bottom and it swaps to the other input and I keep the keyboard / mouse plugged into the monitor and it goes where the input goes.