SDL_Gamepad cannot see my controller for some reason

I will preface this by saying I am VERY out of my depth here. My aim was to make a simple program that reads data from the controller and outputs it into a text file. I am using visual studio 2022, in a C++ console application project. I know steam uses SDL for their controller support and it picks up my controller fine. I assume its some kind of permission issue because I tried the example code of joystick polling and that didn’t work either, so I assume my code isn’t the problem, but here it is anyways:

#include <SDL3/SDL.h>
#include <iostream>

int main(int argc, char* argv[]) {
    SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");

    if (!SDL_Init(SDL_INIT_JOYSTICK)) {
        printf("SDL could not initialize! SDL_Error: |%s|\n", SDL_GetError());
        return 1;
    }

    int joystickCount = 69;
    SDL_JoystickID* joysticks = SDL_GetJoysticks(&joystickCount);

    if (joysticks == NULL) {
        printf("SDL_GetJoysticks failed: %s\n", SDL_GetError());
    }
    else {
        printf("Number of joysticks detected: %d\n", joystickCount);
        SDL_free(joysticks);
    }

    SDL_Quit();

    return 0;
}

I tested this code on my system (Mac Mini, macOS 15.4) and it worked fine.

edit: if you’re on Mac, make sure you turn on USB access in Project Settings → Signing & Capabilities → App Sandbox. Without this, even wireless controllers won’t work.

Yeah, that’s what is confusing me. As far as I can tell, the code isn’t the issue, for some reason SDL doesn’t have the right permissions to see the controller or something. Tomorrow, I will try on my laptop just in case.

About that USB access thing, I’m on windows, I don’t think there is an equivalent setting, but if there is, it might be that.

I just realised after spending like 8 hours trying to get this program working, that the entire time, the reason it wasn’t detecting the controller was because of hidhide… I forgot I had it enabled for my dualsense and steam was allowed through the cloak which is why it was able to work with it. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

(hidhide is a program that hides controllers from all programs except selected ones, or the other way round, so that you can use steam to rebind stuff without the game picking up the original controller inputs)