-
Notifications
You must be signed in to change notification settings - Fork 66
vigem_target_x360_get_user_index returns wrong user index #31
Comments
This function never really was very reliable, it's timing sensitive due to the now aged code base that never really supported capturing the player index. Here's a primitive test: add like a sleep 500 or greater after the plugin call and see if that changes things. |
Thanks for your reply, it does't works. I add std::this_thread::sleep_for(std::chrono::seconds(10)); and XInputGetState before call vigem_target_x360_get_user_index, still returns 0. |
OK, hm, please subscribe to a EVT_VIGEM_X360_NOTIFICATION and print the LedNumber. |
Thanks you very much, it works perfectly. |
Great to hear! I guess figuring out what's wrong with the |
Hi, Strangely, and FWIW, I haven't tried the repro example in the OP here (yet), but essentially I'm using it the same way --
(The full code is in here.) I was a bit surprised when the resulting "user index" is zero-based, but it does increment for each new device, so I guess that's right. Similar specs to the OP...
LMK if any other details or info would be helpful. Thanks for ViGEm! -Max |
Describe the bug
Create and add four x360 devices to the bus, call vigem_target_x360_get_user_index to query the user index, it always returns 0.
To Reproduce
Steps to reproduce the behavior (example):
Compile and run this code.
Expected behavior
Output as below.
#0: user index: 0
#0: serial number: 1
#1: user index: 1
#1: serial number: 2
#2: user index: 2
#2: serial number: 3
#3: user index: 3
#3: serial number: 4
Screenshots
System details (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: