joaorb64 / joycond-cemuhook

Support for cemuhook's UDP protocol for joycond devices
MIT License
148 stars 18 forks source link

not mapping HOME and CAPTURE buttons of Switch Pro Controller #49

Closed cipitaua closed 3 years ago

cipitaua commented 3 years ago

Everything works fine with the switch pro controller, buttons and motion works great, except that home and capture buttons are not recognized by the DSU client (cemu), and thus they are unusable.

These buttons works fine at driver level (see 'PRESSED'):

image

but proper mapping is missing in joycond-cemuhook

joaorb64 commented 3 years ago

From https://github.com/joaorb64/joycond-cemuhook/blob/master/profiles/Nintendo%20Switch%20Pro%20Controller.json, Home should be assigned to PS and capture really isn't assigned to any button. It's supposed to be:

Home → PS (home)
Start → Options
Select → Share

I've checked using Dolphin and they seem to be working. Can you test it there? If you right-click over any input you have access to an advanced ui with all inputs from each input device.

cipitaua commented 3 years ago

Thank you for the reply. It's not clear how to change the json, for example if I put

    "button_share": "BTN_SELECT",
    "button_options": "BTN_START",
    "button_ps": "BTN_HOME",

I get a KeyError: 'BTN_HOME'

More generally, where can I find the list of possible buttons that can be passed to Dolphin or Cemu?

cipitaua commented 3 years ago

By looking at hid-nintendo.c I could understand that BTN_MODE and BTN_Z correspond to home and capture, respectively. However, both "button_ps": "BTN_MODE" and "button_ps": "BTN_Z" are not recognized by cemu, which evidently does not grab the PS button. That's strange, since cemuhook was conceived indeed for cemu :(

cipitaua commented 3 years ago

Here https://v1993.github.io/cemuhook-protocol/ it says that PS button is unused.

joaorb64 commented 3 years ago

Oh. So the buttons are mapped and sent (visible via Dolphin), but Cemu itself doesn't use those buttons at all? Maybe if you use custom mappings? You can also use joycond-cemuhook only for motion and manually map the buttons using the original evdev/js device in Cemu, if it supports mapping those in the UI.

cipitaua commented 3 years ago

You can also use joycond-cemuhook only for motion and manually map the buttons using the original evdev/js device in Cemu, if it supports mapping those in the UI.

I don't think it's possible: cemu gets everything from the same source, that can be evdev/js or cemuhook server. It can't be (or at least I could not) configured to take buttons from evdev/js and motion from cemuhook. In Yuzu it is possible and indeed it works fine.

EDIT: actually it is possible by using the cemuhook plugin, which bypasses the native cemu input. Cemuhook plugin manages separate IMU and leaves the buttons to cemu internal libraries. In that way all the buttons can be used.