Hotas warthog thrustmaster joystick detected twice

I’ve got a HOTAS warthog Thrustmaster A-10 joystick which I would like to access from SDL2. But when I detect with SDL_NumJoysticks the joystick is always counted twice can be opened twice. How do I handle having two joysticks? Or even isn’t that a bug in SDL’s joystick detection?
I use this little snip to detect:

#include \<iostream\>
#include \<SDL2/SDL.h\>
#include \<vector\>

int main() {
     SDL_Init(SDL_INIT_EVERYTHING);

    const auto noOfJoysticks = SDL_NumJoysticks();
    std::cout << "No of joysticks: " << noOfJoysticks << "\n";

    SDL_version ver;
    SDL_GetVersion(&ver);
    std::cout << (int) ver.major << "." << (int) ver.minor << "." << (int) ver.patch << "\n";
    std::vector<SDL_Joystick *> js;
    js.reserve(noOfJoysticks);
    for (int i = 0; i < noOfJoysticks; ++i) {
        if (SDL_IsGameController(i))
            std::cout << "No. " << i << " is game controller\n";

        js[i] = SDL_JoystickOpen(i);

        if (js[i]) {
            printf("Opened Joystick %d\n", i);
            printf("Name: %s\n", SDL_JoystickNameForIndex(i));
            printf("Number of Axes: %d\n", SDL_JoystickNumAxes(js[i]));
            printf("Number of Buttons: %d\n", SDL_JoystickNumButtons(js[i]));
            printf("Number of Hats: %d\n", SDL_JoystickNumHats(js[i]));
            printf("Number of Balls: %d\n", SDL_JoystickNumBalls(js[i]));
        } else {
            printf("Couldn't open Joystick %d\n", i);
        }
    }
    return 0;
}

and get this:

No of joysticks: 2
2.24.0
Opened Joystick 0
Name: Thustmaster Joystick - HOTAS Warthog
Number of Axes: 2
Number of Buttons: 19
Number of Hats: 1
Number of Balls: 0
Opened Joystick 1
Name: Thustmaster Joystick - HOTAS Warthog
Number of Axes: 2
Number of Buttons: 19
Number of Hats: 1
Number of Balls: 0

As you can see I run SDL2 version 2.24.0 and I’m on a Mageia (Cauldron) linux box.

I have now compiled and installed ver. 2.24.2. Still the same.
And I have added an SDL_joystickUpdate(). Still the same.

I added this snippet:

    SDL_Event e;
    auto quit = false;
    while (!quit) {
        while (SDL_PollEvent(&e)) {
            switch (e.type) {
                case SDL_JOYBUTTONDOWN:
                    std::cout << "Joystick no.: " << e.jdevice.which << " Button: " << static_cast<int>(e.jbutton.button) << "\n";
                    break;
            }
        }
    }

Each time I press a joystick button I get:

   Joystick no.: 1 Button: 0
   Joystick no.: 0 Button: 0

It may be remarked that my other joysticks (Logitech Wingman Extreme and Thrustmaster trottle) do no appear twice. And only give one event.

Now that’s interesting. I added

            printf("Joystick path: %s\n", SDL_JoystickPath(js[i]));

And added all my joysticks. Apparently its only the first device that’s duplicated:

No of joysticks: 4
2.24.2
Opened Joystick 0
Name: Logitech Inc. WingMan Extreme Digital 3D
Number of Axes: 4
Number of Buttons: 7
Number of Hats: 1
Number of Balls: 0
Joystick path: /dev/input/js0
Opened Joystick 1
Name: Logitech Inc. WingMan Extreme Digital 3D
Number of Axes: 4
Number of Buttons: 7
Number of Hats: 1
Number of Balls: 0
Joystick path: /dev/input/event0
Opened Joystick 2
Name: Thustmaster Joystick - HOTAS Warthog
Number of Axes: 2
Number of Buttons: 19
Number of Hats: 1
Number of Balls: 0
Joystick path: /dev/input/event7
Opened Joystick 3
Name: Thrustmaster Throttle - HOTAS Warthog
Number of Axes: 5
Number of Buttons: 32
Number of Hats: 1
Number of Balls: 0
Joystick path: /dev/input/event8
Joystick no.: 3 Button: 29

Why did my Wingman suddenly appear as the first? And how can I handle this in a game?

Solved I think. I blacklisted joydev in /etv/modprobe.d. Now every joystick only appears once.
I found a post that joydev is legacy and evdev is the new module.