vJoy
vJoy copied to clipboard
vJoy not working with Web Gamepad API
Hi, This issue is fixed and you will find a summary of the problem and solution below:
Original Question
The Web Gamepad API doesn't seem to be able to show/receive the Axes values:
The buttons work fine, but the axes don't. Here is an example test URL: https://luser.github.io/gamepadtest/
Working solution
njz3 made an update that fixes this problem, but the problem is that he cannot sign the driver, so you will need to follow this guide to install this update:
-
Install the certificate in the "Trusted Root Certification" store. (So open it, click install, [select local user if you have admin rights], click next, select 'install in the following archive', select "Trusted Root Certification", hit next, click confirm)
-
Enable SIGNTEST mode in your windows: Open CMD (or PowerShell) AS ROOT, run
Bcdedit.exe -set TESTSIGNING ON
and then if it says "operation successful", you will need to reboot your computer. [If it didn't say that but it says something about Secure Boot, you will need to disable Secure Boot FIRST]. Now when you computer is booted up, you should see in the bottom right of your desktop the text "Testing Mode" -
Now download this testing build installer and then open it to install.
-
To make sure it will work, open the "Configure vJoy" app and uncheck one of the axis, hit apply and then check the axis again and hit apply.
P.s. If you want the SDK, you can find that at this link
If you still cannot get it to work after trying these methods, you may add a comment to this issue.
I'm running into the exact same issue. It looks like it only effects Chromium based browsers. Firefox is working as intended.
I'm running into the exact same issue. It looks like it only effects Chromium based browsers. Firefox is working as intended.
Chromium based browsers require constant pinging for the buttons to function normally, so I guess this might also have to do something with this problem. But when using an actual controller, it works fine, but I just want to make my own!
And like every browser is based on chromium, except Firefox...
Probably not related to vJoy (as it works in Firefox) ?
Probably not related to vJoy (as it works in Firefox) ?
No it is related! A 'normal' gamepad DOES work on chromium browsers! But vJoy doesn't work!
Just tried with older version of vJoy and got same issue. I guess it is because the gamepad API does not perform polling of the gamepad status, it is event based. vJoy does not send any "USB" status packet like a standard joystick, which means there is no event when the internal values change.
So can that be implemented? Or do you mean that I am using an old version?
It is difficult to tell you whether this is easy to add or not (I do not have enough knowledge to add that function). I tested v2.1.9.1 and v2.2.1.1 and both gave me the same issue.
So what do you suggest now?
Maybe you can modify the gamepad API to perform polling of the status ?
Polling is what all these websites already are using (and what I also already am using)! But yeah still no axis data.
Update: I see https://github.com/njz3/vJoy/blob/master/driver/sys/usb.c which does seem to include some USB packet stuff, but it is mostly commented out
Hi, I found the "bug", and it is in vjoy : vjoy uses 32bits axis values which in very unusual for HID gamepad or joystick. By changing the driver to expose a 16bits value for axis in the HID, the gamepad test you provided works perfectly in chrome.
By changing the driver to expose a 16bits value for axis in the HID
Can you make a new (github) release using that? Since my laptop is too full to install the netstandard developer thingy, so I cannot build it myself.
Or is it an 'setting' that I should change?
I can only compile a test signed build, requiring TESTSIGNING mode to be enabled on your computer.
requiring TESTSIGNING mode to be enabled on your computer.
I believe that is still enabled, and if not, I know how to enable it.
Found another issue with Continuous Hat Switches. They are 32 bits in the HID using 1/100th of a degree unit with range from 0..35900, but this makes a bug when going after 32767 (327,67degrees) : the value roll back to a negative value, meaning it does not display in joy.cpl or other joystick diagnostics tool. I will change it to 1/10th of a degree, limiting to 0..3599.
Here is a build for testing: https://drive.google.com/file/d/1SEYtmJMelM_2xMC0SeO8neArsTy6_fh2/view?usp=sharing The certificate (to be installed in "Trusted Root Certification" store): https://drive.google.com/file/d/1QAWUyx7mptCcIt99xyQ3mjhte9KgxxDY/view?usp=sharing And the SDK: https://drive.google.com/file/d/1r1MUxAatZxZW-fnKETdP7weKKwXJMGkL/view?usp=sharing
It didn't install!
Update: I got 1 step further, I updated the logs above
Have you installed the certificate first ? And do you run in TESTSIGN mode ? (there should be a text watermark in the bottom right corner of your windows desktop)
I didn't install the cert in the correct place first. Now it asks me to install or not, and then it still fails. I updated the logs in the previous message.
(and yeah I dont yet have TESTSIGN enabled, will have to do that, but need to finish some documents first)
The build CANNOT be installed without enabling TESTSIGNING mode on your windows test computer.
Oke sure, I have to disable Secure Boot first...
Please show me screenshot of your certificate store and your watermark
I disbled secure boot and enabled testsign and it installed! But now it seems that Gamepad API doesn't even see the controller AT ALL.
EDIT: the feeder doesn't work. As in buttons don't actually get pressed and the axis are doing strange (Need to set Y axis to 0 to let X work, and Z controls Y)
Btw, does this mode need to stay enabled for me to use this?
The test sign mode must be enabled to use the build I do, because I do not own a valid EV code certificate to sign the driver (Microsoft constraints...). For your feeder issue, I need to see your vJoy configuration and how your perform your test with the feeder. Also, I uploaded a new version a few minutes ago (same download link). Can you download and try again?
The test sign mode must be enabled to use the build I do, because I do not own a valid EV code certificate to sign the driver (Microsoft constraints...). For your feeder issue, I need to see your vJoy configuration and how your perform your test with the feeder. Also, I uploaded a new version a few minutes ago (same download link). Can you download and try again?
Fore my feeder test, I used the feeder and the monitor programs included. I just put the monitor on AOT (AlwaysOnTop) and then I clicked the buttons and changed the sliders and then looked at the output, which didn't match input.
I will try out the new version now and let you know if the issue is changed
I downloaded the new setup thingy and it didn't change it.
Here is a screenshot of the feeder test thingy:
Also a note : I know you cannot detect the joystick on the navigator like Chrome or Edge if you are using a remote desktop to your test computer. You must be physically connected with an open session to detect the joystick. I don't know why.
It cannot find the joystick since you need to press a button for chrome to let it find the gamepad. And since the buttons are NOT working, chrome won't detect/allow detect of the gamepad
Please send me your contact information to see what happen on your personnel setup.
Idk what contact info you mean, but I use Windows 10 Home - 10.0.19045 Build 19045