aframewebvrgamecontroller

Responsive, single button input in A-Frame WebVR


For my A-Frame WebVR game, I need to access a single "controller" button, regardless of platform. For a phone using a magic window or Google Cardboard, any screen tap would count. For Gear VR or Daydream, any button on the controller would count. For a PC VR rig, any button on either controller would count.

Don McCurdy's universal-controls (https://github.com/donmccurdy/aframe-extras/tree/master/src/controls) would seem to be relevant, yet it's not clear how I could use it to do what I want.

I could also go access the GamePad API directly, and separately detect screen taps.

What's the best way to proceed?


Solution

  • Perhaps the input mapping system, from Fernando Serrano could help: https://blog.mozvr.com/input-mapping/