You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is a bug or a feature, but it's confusing behavior, so likely more towards the bug category.
When automatic gamepad mappings are generated, the CRC is included in the GUID used. This means that if a mapping for that gamepad is added after the automatic mapping is generated, the added mapping will be ignored, unless the added mapping includes the CRC. This essentially means you have to add mappings before calling SDL_Init, as if any gamepads are plugged in during SDL_Init, they'll have automatically generated mappings created, and any mappings added later will not be used.
What makes me think this is a bug is SDL_PrivateMatchGamepadMappingForGUID has the following comment in it.
// Clear the CRC from the GUID for matching, the mappings never include it in the GUID
SDL_SetJoystickGUIDCRC(&guid, 0);
Which makes me think adding a mapping with a GUID included is a bug.
The text was updated successfully, but these errors were encountered:
With the following as the mapping string I created (Because the autogenerated mapping is incorrect).
03000000120c0000182e000011010000,REV USB PS4 Compatible Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,
The autogenerated mapping is being created for GUID 0300288e120c0000182e000011010000, with the difference being the CRC.
In general, it seems like any automatically generated mapping includes the CRC in the generated mapping string GUID. I think the fix would be to strip the CRC from the GUID in SDL_PrivateGenerateAutomaticGamepadMapping
Uh oh!
There was an error while loading. Please reload this page.
I'm not sure if this is a bug or a feature, but it's confusing behavior, so likely more towards the bug category.
When automatic gamepad mappings are generated, the CRC is included in the GUID used. This means that if a mapping for that gamepad is added after the automatic mapping is generated, the added mapping will be ignored, unless the added mapping includes the CRC. This essentially means you have to add mappings before calling SDL_Init, as if any gamepads are plugged in during SDL_Init, they'll have automatically generated mappings created, and any mappings added later will not be used.
What makes me think this is a bug is
SDL_PrivateMatchGamepadMappingForGUID
has the following comment in it.Which makes me think adding a mapping with a GUID included is a bug.
The text was updated successfully, but these errors were encountered: