To clarify: You want the Steam Deck to run USB gadget mode and use that to expose its input devices to the other machine?
If so... while searching to see if the SD supports gadget mode (answer: yes) I happened across https://github.com/Frederic98/GadgetDeck - have you tried that?