dist/melonjs.js
function ouyaNormalizeFn(value, axis, button) {
       if (value > 0) {
         if (button === api.GAMEPAD.BUTTONS.L2) {
           // L2 is wonky; seems like the deadzone is around 20000
           // (That's over 15% of the total range!)
           value = Math.max(0, value - 20000) / 111070;
         } else {
           // Normalize [1..65536] => [0.0..0.5]
           value = (value - 1) / 131070;
         }
       } else {
         // Normalize [-65536..-1] => [0.5..1.0]
         value = (65536 + value) / 131070 + 0.5;
       }

       return value;
     }
function ouyaNormalizeFn(value, axis, button) {
       if (value > 0) {
         if (button === api.GAMEPAD.BUTTONS.L2) {
           // L2 is wonky; seems like the deadzone is around 20000
           // (That's over 15% of the total range!)
           value = Math.max(0, value - 20000) / 111070;
         } else {
           // Normalize [1..65536] => [0.0..0.5]
           value = (value - 1) / 131070;
         }
       } else {
         // Normalize [-65536..-1] => [0.5..1.0]
         value = (65536 + value) / 131070 + 0.5;
       }

       return value;
     }
function ouyaNormalizeFn ( value , axis , button ) { if ( value > 0 ) { if ( button === api . GAMEPAD . BUTTONS . L2 ) { // L2 is wonky; seems like the deadzone is around 20000 // (That's over 15% of the total range!) value = Math . max ( 0 , value - 20000 ) / 111070 ; } else { // Normalize [1..65536] => [0.0..0.5] value = ( value - 1 ) / 131070 ; } } else { // Normalize [-65536..-1] => [0.5..1.0] value = ( 65536 + value ) / 131070 + 0.5 ; } return value ; }
Normalize axis values for OUYA
@ignore
Normalize axis values for OUYA