ironically, a lot of modern higher quality USB Keyboards actually pretend to be multiple keyboards plugged into a hub to get around the limitation of how many keys can be pressed at once. the feature is called "n-key rollover".
I think (but i'm not 100% sure) USB Mice do the same to get higher DPI settings to work.
also IIRC non-Bluetooth wireless keyboards/mice just transmit the raw USB packets via radio with no additional controllers or translation inbetween, so they will behave exactly like wired keryboard/mice and therefore don't need any extra code to handle.
and from what i've read online (
EE StackExchange) USB hubs seem way simpler than I expected, though i can't tell if that translates into "being simple to handle in code" as well. as you likely have to keep track of what device you're currently talking to, which ones are currently plugged in, etc.