Code Monkey home page Code Monkey logo

Comments (1)

arieleoar avatar arieleoar commented on August 21, 2024

For someone wondering, this is a solution i came with but i'm still testing it, unfortunatelly i don't have any other controllers to test the other paths but for now at least for this 3rd party Joycons it works:

Then in hid-nintendo.c (:1605)

static int joycon_input_create(struct joycon_ctlr *ctlr)
{
	struct hid_device *hdev;
	const char *name;
	const char *imu_name;
	int ret;
	int i;

        /*Some 3rd party Switch Pro controllers report Product ID 0x2006
          instead of 0x2009.
          Check reported controller type and force Product ID to PROCON.
          Additionally some 3rd party Joycons are reported as Pro Controllers
          so if the ctlr_type is left or right we force JOYCONL or JOYCONR.
        */
        if(ctlr->ctlr_type == JOYCON_CTLR_TYPE_PRO &&
           ctlr->hdev->product != USB_DEVICE_ID_NINTENDO_PROCON){
           ctlr->hdev->product = USB_DEVICE_ID_NINTENDO_PROCON;
        }
	else if (ctlr->ctlr_type == JOYCON_CTLR_TYPE_JCL &&
	   ctlr->hdev->product == USB_DEVICE_ID_NINTENDO_PROCON) {
	   ctlr->hdev->product = USB_DEVICE_ID_NINTENDO_JOYCONL;
	}
	else if (ctlr->ctlr_type == JOYCON_CTLR_TYPE_JCR &&
	   ctlr->hdev->product == USB_DEVICE_ID_NINTENDO_PROCON) {
	   ctlr->hdev->product = USB_DEVICE_ID_NINTENDO_JOYCONR;
	}

Before only the first validation was made to force the Pro Controller product id if the controller type was PRO, but now i added the two additional clauses to force if the controller type is JC left or JC right (and the product id is 0x2009 PROCON) it will force the product id of the controller to their respective joycons L/R product ids.

I can open a PR for your evaluation. Thanks!

from linux.

Related Issues (20)

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.