Search Unity

3rd party switch controllers not getting recognized as a Switch Pro Controller

Discussion in 'Input System' started by print_helloworld, Jan 7, 2021.

  1. print_helloworld

    print_helloworld

    Joined:
    Nov 14, 2016
    Posts:
    231
    I've bought a HORIPAD switch pro controller that is official licensed by Nintendo and it was recognized as a generic joystick and not a Gamepad of any kind (Windows). I figured it might be because the vendor and product IDs dont match the ones of the original switch controller, and if I wired the 3rd party controller to the original it would work. Doing that gives correct input for the dpad, shoulders, triggers, plus/minus, left/right stick presses, leaving the left and right sticks and the ABXY buttons to be misconfigured.

    But the horipad controller is supposed to work with the Switch as its supported official, therefore the data layout of the og switch pro and HORIPAD's should be the same right? Does this mean that the original switch pro controller isn't correctly handled then? Or is the original one correct, but the console is able to handle multiple types of controller data layouts (this wouldn't make sense)?

    I was able to implement the 3rd party controller as a Gamepad using this layout, but my question is, are 3rd party controllers not officially supported despite them theoretically being no different than the originally supported controller?

    Vendor ID: 0xf0d
    Product ID: 0xc1 (HORIPAD S)
    Manufacturer: HORI CO.,LTD.
    Amazon link
     
  2. print_helloworld

    print_helloworld

    Joined:
    Nov 14, 2016
    Posts:
    231
    Same thing with the PowerA core plus controller, rewiring it to use my written layout makes it work perfectly.

    Vendor ID: 0x20d6
    Product ID: 0xa711 (Core (Plus) Wired Controller)
    Manufacturer: ?
     
  3. quirkylemon103

    quirkylemon103

    Joined:
    Aug 1, 2018
    Posts:
    13
    I have the same issue with the core controller
     
  4. dmytro_at_unity

    dmytro_at_unity

    Unity Technologies

    Joined:
    Feb 12, 2021
    Posts:
    212
    Just to clarify, are you saying that HORIPAD switch pro controller doesn't work on Switch itself or doesn't work when plugged in into PC/Linux/mac?

    Support for console gamepads on non-console platforms is a bit spotty. We want to support all devices, but because we're currently lacking HID button mapping, they will be seen as joysticks with "button0", "button1", etc. Hence end-users will need to rebind them in game settings to work properly. We plan to improve state of things in this department so more gamepads will be mapped, but this is a bit of mid-long term thing.

    If it works with https://gamepad-tester.com/ and you see you don't get all sticks/triggers/buttons reported correctly in input system as joystick, then feel free to report a bug (Help->Report bug) because it means our HID layer doesn't support something from that device.
     
  5. print_helloworld

    print_helloworld

    Joined:
    Nov 14, 2016
    Posts:
    231
    @dmytro_at_unity case 1377103

    I haven't tested the horipad or the powera, but I'd imagine that they would work on the switch perfectly considering they're products for the switch. But they did have a slightly different layout when plugged into windows, so I don't know if it's all switch pro controllers that aren't mapped correctly or just 3rd party ones. I don't have the original and true one to check with either.

    I'll do more testing to provide for you and see if things have changed in the recent versions. I tested the Horipad brand switch pro controller on the gamepad tester website and it reported everything correctly. Using it in unity with input system 1.1.1, the controller is mapped as a joystick with no controls or anything, just raw values. If using this, then the controller can be mapped correctly.
     
    Last edited: Oct 30, 2021
  6. dmytro_at_unity

    dmytro_at_unity

    Unity Technologies

    Joined:
    Feb 12, 2021
    Posts:
    212
    > Using it in unity with input system 1.1.1, the controller is mapped as a joystick with no controls or anything, just raw values.

    Unfortunately this is currently is expected behavior, because we're lacking a database of USB HID devices, we have to report them as joysticks, because we don't know which button is which. Sorry about this. Hopefully this will get improved going into the future. Using popcron lib seems the best course of action in meanwhile.
     
  7. print_helloworld

    print_helloworld

    Joined:
    Nov 14, 2016
    Posts:
    231
    Is it possible to have a public database of HID devices similar to this one that Unity can utilize automatically for the input system where users could test and submit layouts? I know its a stretch but it can greatly improve device support for the input system if it comes bundled with community submitted layouts.
     
  8. dmytro_at_unity

    dmytro_at_unity

    Unity Technologies

    Joined:
    Feb 12, 2021
    Posts:
    212
    Yes, a public database is our long wished feature, hopefully we will come around to make it happen sooner than later.
    I'm very inspired lately by SDL2 gamepad database, it's amazing how many devices they support there!
     
    print_helloworld likes this.
  9. dmytro_at_unity

    dmytro_at_unity

    Unity Technologies

    Joined:
    Feb 12, 2021
    Posts:
    212
    @print_helloworld hey, some good news :) I've added support for simple HID reports that these controllers send and tested support with:
    - HORIPAD for Nintendo Switch
    - PowerA NSW Fusion Wired FightPad
    - PDP Wired Fight Pad Pro: Mario
    https://github.com/Unity-Technologies/InputSystem/pull/1504
    Hopefully this lands as part of 1.4.0, and we can then expand support by just adding vid/pids.

    I've also tried joycons, but they need calibration curve work and merging joycons.
     
    print_helloworld likes this.
  10. print_helloworld

    print_helloworld

    Joined:
    Nov 14, 2016
    Posts:
    231
    Brilliant, I saw the commit related to this change. if anyone finds another 3rd party that isnt mapped correctly then it might be worth to submit a pull request to add your device's specific manufacter veondor and product IDs to this class along with tests as per pr guidelines
     
  11. dmytro_at_unity

    dmytro_at_unity

    Unity Technologies

    Joined:
    Feb 12, 2021
    Posts:
    212
  12. Videoludid

    Videoludid

    Joined:
    Dec 10, 2019
    Posts:
    3
    Hi, I have another type of switch controller which is not correctly recognized by Unity: .
    I have to bind every button by hand (they are named button0, 1, 2, etc.), and I can't map the right stick (it's defined as two 1D vectors Z and RZ)
    The D-PAD is called "Hat".


    {
    "interface": "HID",
    "type": "",
    "product": "Core (Plus) Wired Controller",
    "serial": "000000000001",
    "version": "512",
    "manufacturer": "Bensussen Deutsch & Associates,Inc.(BDA)",
    "capabilities": "{\"vendorId\":8406,\"productId\":42769,\"usage\":5,\"usagePage\":1,\"inputReportSize\":9,\"outputReportSize\":0,\"featureReportSize\":0,\"elements\":[{\"usage\":1,\"usagePage\":9,\"unit\":0,\"unitExponent\":0,\"logicalMin\":0,\"logicalMax\":0,\"physicalMin\":0,\"physicalMax\":0,\"collectionIndex\":0,\"reportType\":1,\"reportId\":0,\"reportCount\":1,\"reportSizeInBits\":1,\"reportOffsetInBits\":8,\"flags\":2},{\"usage\":2,\"usagePage\":9,\"unit\":0,\"unitExponent\":0,\"logicalMin\":0,\"logicalMax\":0,\"physicalMin\":0,\"physicalMax\":0,\"collectionIndex\":0,\"reportType\":1,\"reportId\":0,\"reportCount\":1,\"reportSizeInBits\":1,\"reportOffsetInBits\":9,\"flags\":2},{\"usage\":3,\"usagePage\":9,\"unit\":0,\"unitExponent\":0,\"logicalMin\":0,\"logicalMax\":0,\"physicalMin\":0,\"physicalMax\":0,\"collectionIndex\":0,\"reportType\":1,\"reportId\":0,\"reportCount\":1,\"reportSizeInBits\":1,\"reportOffsetInBits\":10,\"flags\":2},{\"usage\":4,\"usagePage\":9,\"unit\":0,\"unitExponent\":0,\"logicalMin\":0,\"logicalMax\":0,\"physicalMin\":0,\"physicalMax\":0,\"collectionIndex\":0,\"reportType\":1,\"reportId\":0,\"reportCount\":1,\"reportSizeInBits\":1,\"reportOffsetInBits\":11,\"flags\":2},{\"usage\":5,\"usagePage\":9,\"unit\":0,\"unitExponent\":0,\"logicalMin\":0,\"logicalMax\":0,\"physicalMin\":0,\"physicalMax\":0,\"collectionIndex\":0,\"reportType\":1,\"reportId\":0,\"reportCount\":1,\"reportSizeInBits\":1,\"reportOffsetInBits\":12,\"flags\":2},{\"usage\":6,\"usagePage\":9,\"unit\":0,\"unitExponent\":0,\"logicalMin\":0,\"logicalMax\":0,\"physicalMin\":0,\"physicalMax\":0,\"collectionIndex\":0,\"reportType\":1,\"reportId\":0,\"reportCount\":1,\"reportSizeInBits\":1,\"reportOffsetInBits\":13,\"flags\":2},{\"usage\":7,\"usagePage\":9,\"unit\":0,\"unitExponent\":0,\"logicalMin\":0,\"logicalMax\":0,\"physicalMin\":0,\"physicalMax\":0,\"collectionIndex\":0,\"reportType\":1,\"reportId\":0,\"reportCount\":1,\"reportSizeInBits\":1,\"reportOffsetInBits\":14,\"flags\":2},{\"usage\":8,\"usagePage\":9,\"unit\":0,\"unitExponent\":0,\"logicalMin\":0,\"logicalMax\":0,\"physicalMin\":0,\"physicalMax\":0,\"collectionIndex\":0,\"reportType\":1,\"reportId\":0,\"reportCount\":1,\"reportSizeInBits\":1,\"reportOffsetInBits\":15,\"flags\":2},{\"usage\":9,\"usagePage\":9,\"unit\":0,\"unitExponent\":0,\"logicalMin\":0,\"logicalMax\":0,\"physicalMin\":0,\"physicalMax\":0,\"collectionIndex\":0,\"reportType\":1,\"reportId\":0,\"reportCount\":1,\"reportSizeInBits\":1,\"reportOffsetInBits\":16,\"flags\":2},{\"usage\":10,\"usagePage\":9,\"unit\":0,\"unitExponent\":0,\"logicalMin\":0,\"logicalMax\":0,\"physicalMin\":0,\"physicalMax\":0,\"collectionIndex\":0,\"reportType\":1,\"reportId\":0,\"reportCount\":1,\"reportSizeInBits\":1,\"reportOffsetInBits\":17,\"flags\":2},{\"usage\":11,\"usagePage\":9,\"unit\":0,\"unitExponent\":0,\"logicalMin\":0,\"logicalMax\":0,\"physicalMin\":0,\"physicalMax\":0,\"collectionIndex\":0,\"reportType\":1,\"reportId\":0,\"reportCount\":1,\"reportSizeInBits\":1,\"reportOffsetInBits\":18,\"flags\":2},{\"usage\":12,\"usagePage\":9,\"unit\":0,\"unitExponent\":0,\"logicalMin\":0,\"logicalMax\":0,\"physicalMin\":0,\"physicalMax\":0,\"collectionIndex\":0,\"reportType\":1,\"reportId\":0,\"reportCount\":1,\"reportSizeInBits\":1,\"reportOffsetInBits\":19,\"flags\":2},{\"usage\":13,\"usagePage\":9,\"unit\":0,\"unitExponent\":0,\"logicalMin\":0,\"logicalMax\":0,\"physicalMin\":0,\"physicalMax\":0,\"collectionIndex\":0,\"reportType\":1,\"reportId\":0,\"reportCount\":1,\"reportSizeInBits\":1,\"reportOffsetInBits\":20,\"flags\":2},{\"usage\":14,\"usagePage\":9,\"unit\":0,\"unitExponent\":0,\"logicalMin\":0,\"logicalMax\":0,\"physicalMin\":0,\"physicalMax\":0,\"collectionIndex\":0,\"reportType\":1,\"reportId\":0,\"reportCount\":1,\"reportSizeInBits\":1,\"reportOffsetInBits\":21,\"flags\":2},{\"usage\":57,\"usagePage\":1,\"unit\":20,\"unitExponent\":0,\"logicalMin\":0,\"logicalMax\":7,\"physicalMin\":0,\"physicalMax\":315,\"collectionIndex\":0,\"reportType\":1,\"reportId\":0,\"reportCount\":1,\"reportSizeInBits\":4,\"reportOffsetInBits\":24,\"flags\":66},{\"usage\":53,\"usagePage\":1,\"unit\":0,\"unitExponent\":0,\"logicalMin\":0,\"logicalMax\":255,\"physicalMin\":0,\"physicalMax\":255,\"collectionIndex\":0,\"reportType\":1,\"reportId\":0,\"reportCount\":1,\"reportSizeInBits\":8,\"reportOffsetInBits\":56,\"flags\":2},{\"usage\":50,\"usagePage\":1,\"unit\":0,\"unitExponent\":0,\"logicalMin\":0,\"logicalMax\":255,\"physicalMin\":0,\"physicalMax\":255,\"collectionIndex\":0,\"reportType\":1,\"reportId\":0,\"reportCount\":1,\"reportSizeInBits\":8,\"reportOffsetInBits\":48,\"flags\":2},{\"usage\":49,\"usagePage\":1,\"unit\":0,\"unitExponent\":0,\"logicalMin\":0,\"logicalMax\":255,\"physicalMin\":0,\"physicalMax\":255,\"collectionIndex\":0,\"reportType\":1,\"reportId\":0,\"reportCount\":1,\"reportSizeInBits\":8,\"reportOffsetInBits\":40,\"flags\":2},{\"usage\":48,\"usagePage\":1,\"unit\":0,\"unitExponent\":0,\"logicalMin\":0,\"logicalMax\":255,\"physicalMin\":0,\"physicalMax\":255,\"collectionIndex\":0,\"reportType\":1,\"reportId\":0,\"reportCount\":1,\"reportSizeInBits\":8,\"reportOffsetInBits\":32,\"flags\":2}],\"collections\":[]}"
    }