Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending inputs to another virtual controller instance #13

Closed
crossbr1 opened this issue Mar 10, 2023 · 7 comments
Closed

Sending inputs to another virtual controller instance #13

crossbr1 opened this issue Mar 10, 2023 · 7 comments

Comments

@crossbr1
Copy link

Hi, I made a script in python to receive data and send input using vgamepad, the script is working perfectly using keyboard but my intention was that it send inputs to the virtual controller created by ds4windows, I dont know much of coding but from what I noticed both instances have the same hardware ID and the one made by ds4windows is set to xinput id 0 and the one made by vgamepad is set to xinput id 1, could you give me any advice on how I could make it work.

The script is only suppose to simulate the right trigger release sending simulate_right_trigger(0)

@yannbouteiller
Copy link
Owner

Hi, sorry I am not sure what you are trying to achieve here. Can you describe your project more precisely?

(Closing as this is apparently a question more than an issue, but feel free to continue the discussion here)

@crossbr1
Copy link
Author

crossbr1 commented Mar 11, 2023

The script receives data from a udp socket from the game forza horizon 5, the script then calculates the tire slip rate to kill the right trigger input preventing the car from wheel spin (traction control). I have a ds4 controller so I need vgamepad to release the trigger from the ds4windows virtual controller instead of creating a new one.
HTCS.log

@yannbouteiller
Copy link
Owner

yannbouteiller commented Mar 11, 2023

Ah I see, I am afraid vgamepad cannot modify the input from your other gamepads sorry. What maybe you could do is capture the input from your actual gamepad and reproduce it in a second (virtual) gamepad created via vgamepad that you would use in forza instead of your actual gamepad, so you could hack the input as much as you like

@crossbr1
Copy link
Author

I thought because both use the vigem bus driver maybe it was just a matter of specifying the id.

anyway thanks for your time

@yannbouteiller
Copy link
Owner

But the vigembus driver is for emulating gamepads as far as I know, can it also hook real gamepads?

@crossbr1
Copy link
Author

crossbr1 commented Mar 11, 2023

As I said idk much of coding and how things work but ds4windows uses vigem to create a x360 virtual controller the same as vgamepad, what Im trying to understand is how vgamepad knows which virtual controller is suppose to receive input when there is 2 virtual x360 controllers connected at the same time

I'll try to ask in nefarius discord

@yannbouteiller
Copy link
Owner

I think vigembus gives an index to each attached device, in vgamepad you can retrieve this index with the get_index method, but I suppose that is what you called device ID 0 and 1.

I think I understand you want to hook into another virtual device that is already created with vigembus? Not sure whether it is possible at all, but if it is you will probably need to use vigem directly, I don't think vgamepad exposes an API that enables doing that atm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants