Giter VIP home page Giter VIP logo

Comments (1)

splace avatar splace commented on September 26, 2024

FWIW

i added;

var ChromeGenericController = function(raw, into, index) {
    into.leftStickX = raw.axes[0];
    into.leftStickY = raw.axes[1];
    into.rightStickX = raw.axes[3];
    into.rightStickY = raw.axes[2];
    into.faceButton0 = raw.buttons[0];
    into.faceButton1 = raw.buttons[1];
    into.faceButton2 = raw.buttons[2];
    into.faceButton3 = raw.buttons[3];
    into.leftShoulder0 = raw.buttons[5];
    into.rightShoulder0 = raw.buttons[7];
    into.leftShoulder1 = raw.buttons[4];
    into.rightShoulder1 = raw.buttons[6];
    into.select = raw.buttons[8];
    into.start = raw.buttons[9];
    into.leftStickButton = raw.buttons[10];
    into.rightStickButton = raw.buttons[11];
    into.dpadUp = raw.axes[5] < -0.5 ? 1 : 0;
    into.dpadDown = raw.axes[5] > 0.5 ? 1 : 0;
    into.dpadLeft = raw.axes[4] < -0.5 ? 1 : 0;
    into.dpadRight = raw.axes[4] > 0.5 ? 1 : 0;
   // From http://msdn.microsoft.com/en-us/library/windows/desktop/ee417001(v=vs.85).aspx
    into.deadZoneLeftStick = 7849.0/32767.0;
    into.deadZoneRightStick = 8689/32767.0;
    into.deadZoneShoulder0 = 0.5;
    into.deadZoneShoulder1 = 30.0/255.0;
};

and
} else if (isChrome) {
active.push([ '07b5', '0312', ChromeGenericController, "Generic Controller(PS2 like)", Gamepad_ImageDataUrls_Xbox360 ]);
}

and it now works.

from gamepad.js.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.