Hello!
I often use my keyboard with a desktop PC but sometimes I also need to (concurrently) work with a laptop and unplug / plug my keyboard every time I need to switch device is a hassle. (I don’t wanna use laptop keyboard.)
so I’m thinking about how to switch between usb-wired devices. is it enough to just switch D+ and D- ?
like this:
imagine I have a keyboard with 2 usb ports, 1 plugged to PC and another to laptop
then if I want to switch between PC and Laptop, I just flip the toggle switch.
I’m not sure if it’s alright to connect vcc,gnd from both hosts.
I just bought exactly that UGREEN switch and it works perfectly without external power even with a Tada68, Logitech Unified dongle and Wacom tablet plugged in.
Don’t risk the DPDT switch idea. You could easily damage one or other host if there’s a difference in ground potential. Get the UGreen USB switch mentioned below.