0

Is there a way to detect motion controls from a JoyCon in vanilla JavaScript? If it's not possible, would I be able to use another API besides Gamepad API?

window.addEventListener("gamepadconnect", function(e) {
  //How would I detect motion controls?
});
noname
  • 291
  • 1
  • 12

1 Answers1

0

Gamepad Extensions describes motion inputs for gamepads, but it's not officially part of the specification and no browsers implement it for Switch controllers.

It's possible to access Joy-Con motion inputs with WebHID.

nondebug
  • 761
  • 3
  • 5