You're welcome. It sort of already does that. To use your terminology, if plug in pc, use as slave. If plug a mouse, use as master. If plug in both, I think it defaults to slave, so things like mouse will not work. Or it might be the other way round, default to master? Anyway, in either case, it cannot work in both modes at the same time, which is what you need, right?