src/components/tracked-controls-webvr.js
function () {
    var buttonState;
    var controller = this.controller;
    var id;

    if (!controller) { return; }

    // Check every button.
    for (id = 0; id < controller.buttons.length; ++id) {
      // Initialize button state.
      if (!this.buttonStates[id]) {
        this.buttonStates[id] = {pressed: false, touched: false, value: 0};
      }
      if (!this.buttonEventDetails[id]) {
        this.buttonEventDetails[id] = {id: id, state: this.buttonStates[id]};
      }

      buttonState = controller.buttons[id];
      this.handleButton(id, buttonState);
    }
    // Check axes.
    this.handleAxes();
  }
function () {
    var buttonState;
    var controller = this.controller;
    var id;

    if (!controller) { return; }

    // Check every button.
    for (id = 0; id < controller.buttons.length; ++id) {
      // Initialize button state.
      if (!this.buttonStates[id]) {
        this.buttonStates[id] = {pressed: false, touched: false, value: 0};
      }
      if (!this.buttonEventDetails[id]) {
        this.buttonEventDetails[id] = {id: id, state: this.buttonStates[id]};
      }

      buttonState = controller.buttons[id];
      this.handleButton(id, buttonState);
    }
    // Check axes.
    this.handleAxes();
  }
function ( ) { var buttonState ; var controller = this . controller ; var id ; if ( ! controller ) { return ; } // Check every button. for ( id = 0 ; id < controller . buttons . length ; ++ id ) { // Initialize button state. if ( ! this . buttonStates [ id ] ) { this . buttonStates [ id ] = { pressed : false , touched : false , value : 0 } ; } if ( ! this . buttonEventDetails [ id ] ) { this . buttonEventDetails [ id ] = { id : id , state : this . buttonStates [ id ] } ; } buttonState = controller . buttons [ id ] ; this . handleButton ( id , buttonState ) ; } // Check axes. this . handleAxes ( ) ; }
Handle button changes including axes, presses, touches, values.
Handle button changes including axes presses touches values .