简体   繁体   中英

Is there a way to detect motion controls in JavaScript?

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?
});

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM