Ok I figured out the fix. In gptokey.cpp the function calls have to swapped around so the gamecontrollerdb.txt in the config gets called.
So the fix would be:
if (const char* db_file = SDL_getenv("SDL_GAMECONTROLLERCONFIG_FILE")) {
SDL_GameControllerAddMappingsFromFile(db_file);
}
// SDL initialization and main loop
if (SDL_Init(SDL_INIT_GAMECONTROLLER) != 0) {
printf("SDL_Init() failed: %s\n", SDL_GetError());
return -1;
}
Still gotta test it with a game but it should be correct.
UPDATE: Tested and working fine.