• Welcome to PiBoSo Official Forum. Please login or sign up.
 
April 19, 2024, 02:28:41 PM

News:

World Racing Series beta14 available! :)


Input plugin - inject to existing controller

Started by Nihil, February 27, 2022, 02:26:14 PM

Previous topic - Next topic

HornetMaX

Quote from: Nihil on March 03, 2022, 06:21:54 AMAnyway, results -
As you remember I wanted to have this input plugin pretend to be the controller, so both it and the controller would be bound to lean or throttle and mix inputs.
So I gave my input plugin the same UUID as the gamepad.
That didn't work.

1. Plugin does not appear in calibration screen. even when working and transmitting data.

So we can stop here.

I'm not sure giving your plugin the same UUID as the pad is a good idea. One of the two U is for "Unique".
I think your plugin should be seen as a separate device, even if it actually takes some inputs from the pad and alters them. GOB must think you have 2 independent devices connected.

That said, as in GPB you cannot select which device to use (when assigning inputs you just move your input device and GPB detects that automatically), I 'm not sure how that will work. Maybe with one of GPB .ini files ? Di dyou check in the Documentation section ?

This in particular: https://forum.piboso.com/index.php?topic=9789.0

Nihil

Yes, this stops here I believe.

Plugin and controller can not be mixed.
The UUID seems to be used to assign a bind to a controller.
If you give the plugin the same UUID as your gamepad in controls.txt - it will just take over it and you won't need to re-bind the controls by selecting each one and giving an input/moving the stick.

If you want to re-bind your input plugin, you can either attach it to a device that will feed real input and actually move a stick,

Or you could programatically send the input.
I had my input plugin send max value for X-Axis, so when I clicked on "lean" in settings it just assigned it because the stick was "pressed".

Thanks for the link to the docs, I will now move to pipe gamepad input through a proxy, and will probably need to disable it as you suggest.

HornetMaX

It seems to me that you could:
  • Assign a dedicated UUID to your input plugin, so that there are 2 devices (the real joypad and the input plugin)
  • Have your input plugin "read" values from the joypad, alter them and expose the modified values to GPB. Easy thing to try: multiply the values by 2 (cap where necessary, of course).
  • To avoid binding problems, disable all relevant inputs of the gamepad using joysticks.cfg. This way when you move a stick GPB will only see your input plugin move (not both the input plugin and the pad) and bind correctly.

Nihil

exactly right. I'll probably open new thread for "Rider assist" when I make progress.

Thanks a lot for all your help!