libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
9.98k stars 1.84k forks source link

For SDL Gamepads: How to map controller hubs like Mayflash DolphinBar? #6817

Open HomeStarRunnerTron opened 1 year ago

HomeStarRunnerTron commented 1 year ago

Hi-hi! I was directed here from the SDL_GameControllerDB. I have a Mayflash DolphinBar which allows me to pair four Wii Controllers to the computer through its Controller Mode. When they pair, they're all part of the same GUID, and when I try to add them each to my Gamepad Database, the mappings can't all co-exist, so only one ends up being read.

03000000790000000318000000010000,DolphinBar Player 1 Classic Controller,a:b8,b:b12,back:b32,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b44,leftshoulder:b16,lefttrigger:b24,leftx:a0,lefty:a4,rightshoulder:b20,righttrigger:b28,rightx:a8,righty:a12,start:b36,x:b0,y:b4,platform:Mac OS X,

03000000790000000318000000010000,DolphinBar Player 2 Classic Controller,platform:Mac OS X,a:b9,b:b13,x:b1,y:b5,back:b33,guide:b45,start:b37,leftshoulder:b17,rightshoulder:b21,dpup:h1.1,dpdown:h1.4,dpleft:h1.8,dpright:h1.2,leftx:a1,lefty:a5,rightx:a9,righty:a13,lefttrigger:b25,righttrigger:b29,

03000000790000000318000000010000,DolphinBar Player 3 GameCube Controller,platform:Mac OS X,a:b10,b:b14,x:b2,y:b6,start:b38,leftshoulder:b18,rightshoulder:b22,dpup:h2.1,dpdown:h2.4,dpleft:h2.8,dpright:h2.2,leftx:a2,lefty:a6,rightx:a10,righty:a14,lefttrigger:b26,righttrigger:b30,

03000000790000000318000000010000,DolphinBar Player 4 GameCube Controller,platform:Mac OS X,a:b11,b:b15,x:b3,y:b7,start:b39,leftshoulder:b19,rightshoulder:b23,dpup:h3.1,dpdown:h3.4,dpleft:h3.8,dpright:h3.2,leftx:a3,lefty:a7,rightx:a11,righty:a15,lefttrigger:b27,righttrigger:b31,

I notice I can still use this single GUID to map all four of my controllers in Dolphin, but beyond that, no other SDL2 program seems to read the four controllers. Is there anything that can be done to allow multiple mappings? All the best!

slouken commented 1 year ago

You only need one mapping for each type of controller, any number of controllers can share a single mapping. The problem is that the DolpinBar probably shows up to the operating system as a single controller with many buttons and axes. I don't have a DolpinBar, so I can't help unfortunately.

I'm closing this for now, feel free to reopen this if you have a solution or suggestion.

HomeStarRunnerTron commented 1 year ago

Yes, you're correct -- it shows up as a single controller with many buttons and axes. It would just be nice if different mappings could all share the same GUID. But I understand if that's not possible-- it'd just be incredible in my case, since it'd give me four functional controllers right off the bat.

slouken commented 1 year ago

Yes, I see what you're saying. I'll reopen and we can look at this again in SDL 3.0