tomayac / joy-con-webhid

Use the Nintendo Switch Joy-Cons via the WebHID API
https://tomayac.github.io/joy-con-webhid/demo/
Apache License 2.0
135 stars 19 forks source link

JoyCon(R) sometimes has a productName of "Wireless Gamepad" #16

Open light2peter opened 1 year ago

light2peter commented 1 year ago

Windows 10 / Chrome 109.0.5414.75, I see the JoyCon as "Wireless Gamepad".

When this happens, src/index.js creates it as a GeneralController:

https://github.com/tomayac/joy-con-webhid/blob/518a5d34d585e1844b6daf42310b975ab2631835/src/index.js#L103

In this case, the GeneralController doesn't get properly visualized in demo/index.js. It shows up as conflicting events for the left controller, plus the right joycon orientation doesn't appear.

tomayac commented 1 year ago

@nondebug, do you have an idea why this might happen? Sounds like some sort of race condition. I have personally never run into this on my Mac, but the reporter is on Windows.

nondebug commented 1 year ago

I haven't seen this before but a race condition sounds likely.

"Wireless Gamepad" isn't a string that comes from Chrome but it matches the product name used by Switch Pro Controller. Did you happen to have a Pro controller connected?

tomayac commented 1 year ago

@light2peter, do you have an answer to https://github.com/tomayac/joy-con-webhid/issues/16#issuecomment-1419571000?