nefarius / ViGEmBus

Windows kernel-mode driver emulating well-known USB game controllers.
https://docs.nefarius.at/projects/ViGEm/
BSD 3-Clause "New" or "Revised" License
3.08k stars 285 forks source link

Is it possible to rename instances of ViGemBus? #103

Closed albfan closed 2 years ago

albfan commented 3 years ago

Is your feature request related to a problem? Please describe.

I'm modifying XJoy for better handling of several joycons, but end with a list of same ViGemBus instances:

image

Describe the solution you'd like At time ViGemBus client is instanciated, is it possible to set name for it? As I'm able to read joycon data (as colors) I want to create a list like:

instead of:

But for shake of simplicity:

Would be just right

Describe alternatives you've considered Nothing I'm aware of

Additional context For any third party app using ViGemBus, rename controller so you have a sight of what app creates that would be helpful

Paliverse commented 3 years ago

I second this if it's possible to set a custom name!

albfan commented 3 years ago

The name "a static text", is created and passed here: https://github.com/ViGEm/ViGEmBus/blob/master/sys/XusbPdo.cpp#L49 https://github.com/ViGEm/ViGEmBus/blob/master/sys/XusbPdo.cpp#L88

I'm following the device allocation to find how to pass custom text on controller creation PdoCreateDevice, PdoPrepareDevice...

nefarius commented 3 years ago

It is possible, although careful with your expectations. These names are "cached" in special registry sections upon device creation and there are some circumstances to be aware of that might be in the way of reliably putting a custom name on virtual devices.

albfan commented 3 years ago

Sure. Don't expect the name to change that much for final user, once you pair your devices probably your names would be the same all the time.

Any hint about this would be appreciated, can find the connection between vigem_connect and those lines. I can build/test and provide feedback.

nefarius commented 3 years ago

The mentioned sections are not the right spot. I can give you more insight once back at PC.

albfan commented 3 years ago

That would be great, the make a PoC PR and see where we are.

nefarius commented 2 years ago

Closed since there is no consistent solution that would not result in lots of wonky work.