Can't fully read joy-cons in any mode
Joy-cons can be connected to SDL in one of two modes: combined and separate
In combined, the following inputs are not obtainable:
- SL and SR of both joy-cons
- Motion data from the left joy-con
In separate, the following inputs are not obtainable:
- L and ZL of the left joy-con
- R and ZR of the right joy-con
In addition, motion inputs are mapped as if the joy-cons were being held individually, which is a bit painful but still workable.
If you want to e.g. map a reasonable wiimote + nunchuk mapping in Dolphin, the only way to do it (on macOS) is:
- Use separate mode (otherwise you can't get motion data for the nunchuk)
- Use rotated motion data from the left joy con as nunchuk motion data (Backward → Left, Forward → Right, Left → Forward, Right → Backward)
- Use rotated motion data from the right joy con as wiimote motion data (Forward → Left, Backward → Right, Right → Forward, Left → Backward, Roll Left → Pitch Up, Roll Right → Pitch Down, Pitch Down → Roll Left, Pitch Up → Roll Right)
- Use triggers from the combined joycon MFi controller that SDL happens to expose on macOS (!)
This also means that single-joy-con input utilizing triggers is not possible, as you can't get access to them without connecting a second joy-con (in both SDL HIDAPI and macOS MFi).
This is not ideal. There should be a connection mode where all button inputs are accessible from the connected program, even if it means mapping some of the buttons a bit weirdly.
The MFi controller doesn't seem to be universally available, even on macOS. Another user on the Dolphin Discord server didn't have it, even though they were running the same macOS version as I am.
For what to map buttons as...
It might make sense to map SL/SR as paddles in combined mode. They're in similar positions, and it's always useful to have a few extra buttons for activating hotkeys in emulators and such.
That just leaves the left joy-con motion data. Maybe leave that for separate mode? Or add it as additional sensors 3 and 4?
For separate mode, the triggers aren't in an especially pressable place if you assume the user is holding the controller sideways, so I'm not sure what labels to give them. It would mostly be useful for if you're actually holding the controller like you would in combined mode, just with one instead of two.
When the GCController (MFi) driver is used, Apple doesn't report the SL/SR buttons in combined mode at all. You also don't have a choice about whether they're combined or separate. The way the HIDAPI driver reports input is exactly the same as the Apple driver, in terms of what's available in each mode.
I'm just using the GCController driver as a hack to get the triggers, because it's still in combined mode even when the HIDAPI driver is in separate mode.
(So if you combine inputs from all three (L, R, and MFi Combined), you can get every button from the Joy-Con at once)
The SL/SR buttons are now mapped as paddles, and the left/right sensors are now available individually in combined mode.