https://www.amazon.com/dp/B001D1UTC4/ref=cm_sw_r_udp_awd_g1Y2tb1BDV7S6ZEG
This seems like a decent cheap solution, but does it ever seem like it causes any added input lag or anything funky?
As far as I can tell, this switch is passive, meaning basically mechanical. It's just re-routing the lines from the two input ports to the appropriate pair of output cables. It isn't actually a USB host/peripheral itself.
The only trickery they seem to do is that I *think* they try to keep your device initialized at all times by using at least one of the attached hosts to provide power at all times. I *think* they only switch the data lines. Not sure about this. It's slightly annoying in that respect, because I have a USB keyboard that also works with a PS/2 adapter, which I use on computer to free up a USB port, but because it never powers the keyboard down between hosts, it never re-detects which connection type is in use and won't work correctly for one or the other, depending on which one was used first. I have to use USB on the PC to make it work. Annoying, but not a huge deal really.
At any rate, if I understand the mechanism, that means it's basically a very complicated Y cable/switch, rather than being a middleman that actively participates in the USB traffic. It certainly doesn't show up as a hub in Windows' device manager.