Solved a problem but want to know what happened

I have two different game controllers, I’m providing the links to show what they look like but one is a thrustmaster t flight stick joystick https://www.thrustmaster.com/products/t-flight-stick-x/ and the other is a generic usb gamepad like this one https://ae01.alicdn.com/kf/HTB1WLWRn0rJ8KJjSspaq6xuKpXaI/USB-Wired-Joypad-Gamepad-Joystick-Controller-For-PC-Win-7-8-XP-Double-Shock-Gamepad-For.jpg.

When I played a dos game with my joystick everything works as it should, but when I plugged my gamepad into my computer as well as my joystick suddenly the buttons on my joystick start doing different things. It seemed as if the joystick buttons were acting as a second HAT switch (the little directional knob on the top of the joystick and button 1 and 2 (trigger and button on top next to HAT) weren’t behaving like they normally do in the game.

I think retroarch got the game controllers mixed up somehow so it was reading the inputs from my joystick but was treating my joystick like it was a gamepad (I think because the gamepad has two directional sticks retroarch saw that as two HAT switches and assigned my joystick buttons to the second HAT function). I also assumed the issue was that when the joystick was alone it was game controller #1 and when I added the gamepad it was downgraded to #2 and that caused retroarch to get the two confused.

I tried changing the “mapped port” and “device type” around in Main Menu/Quick Menu/Controls/Port 1 controls but that didn’t seem to help. Instead I just unplugged the gamepad. Later when I tried that again to see if the problem was still there it wasn’t.

The problem seems to have disappeared but I do want to know what happened and if it happens again I really don’t want to keep plugging and unplugging things in my usb ports, it’s bad for the ports and wears them down.

1 Like

This is a known issue and is not directly related to RetroArch itself. I believe what you observed is what I described in a previous reply to someone else Xbox controller moving to other ports as the USB problem. In short, the USB ports on your computer have an order. It depends what controller you put to which port, and worse, in what order you put them. With wireless controllers (adapters connected with an USB connection) its even worse.

Once you found a working setup, make sure to not unplug the controllers anymore. Remember where each controller is connected to. I have/had multiple controllers and this issue plagues me since years (at least in Linux, but Windows probably have a similar issue).

1 Like

In Windows, there’s an external utility called "devreorder’ that can help assign specific controllers to specific connection orders.

1 Like

OK, thank you for your help. I will bookmark that post with the solution.

My joystick changed number order just randomly, one day it was game controller number 2 the next it was number 1. The problem returned and didn’t go away even if I unplugged and plugged the gamepad back. Eventually the joystick returned to controller number 2 and the problem resolved itself but I really don’t want this to be a reoccurring problem. Does anybody have any solutions yet?

I don’t know if this worked and I hope someone who might know more than I could figure out if this is in fact a solution but I did try removing the gamepad digitally from my settings instead of physically, I shut down the computer at the end of the day, and the next day the joystick was number 2 and the problem was fixed.

It happened again (my joystick and game controller switched numbers) and it looks as if retroarch is assigning keyboard commands to my joystick. The game (Star Wars:X-Wing 1993) in dosbox pure is supposed to only know joystick button 1 and 2 along with the directional commands but my buttons are issuing game commands normally associated with keyboard presses. I recognize the num pad keys seemed to be assigned to my buttons and while it’s not doing it this time I do remember last time the [s] key was assigned to one of my buttons

Why is Retroarch giving my joystick keyboard inputs? And only if a gamepad is also connected?

DosBox Pure uses a database to automatically map the emulated keyboard+mouse to gamepads to allow people to play games with gamepads out-of-the-box (i.e., without a bunch of manually mapping of keyboard keys, etc.). Perhaps that’s what’s going on for you?

2 Likes

Is there a way to disable this? I map keyboard keys to my joystick using a program called “Antimicrox” and I’d prefer to use that instead of retroarch as I can keep the program to the side while I play the game (since my game is fullscreen and not widescreen). And no, the program is not causing the problem. I tried running the game through retroarch without the other program on to make sure of that. With just the game and retroarch the program still persists as long as the second gamepad is connected.

1 Like

If it’s not making any difference whether it’s running or not, it’s probably not related.

Again, it sounds like it could be dosbox pure’s auto-mapping. Maybe try one of the other dosbox cores to see if it acts any differently there.

What other dos cores are there other than Dosbox Pure? There isn’t a way to shut the auto mapping off?

Might this option be what you are looking for? Run DOSBox-pure and open the RetroArch menu: Core Options > Input > “Advanced>Automatic Game Pad Mappings” = OFF. That’s the side from the emulator/core. RetroArch itself has automatic controller configs and optionally controller remaps, but I think that’s not what hunterk was talking about.

As for the question what other DOSBox cores are, there is also the non Pure version: https://docs.libretro.com/library/dosbox/ But this one is not as integrated as Pure and does not have the newer features from it. It’s more inline with the standalone version, if I understand it correctly. I think the suggestion is to test if its a “problem” that happens with this core, so we know if its a problem with DOSBox in general or with Pure specifically.

1 Like

Crazy thing, ever since you posted your reply the problem hasn’t cropped up again, even though I have both controllers connected to my computer. I was waiting for it to happen to try your solution but it hasn’t.

If it does happen again I will try your solution and let you guys know if it works or doesn’t.

1 Like

It happened again, so I tried your method, I’m assuming you meant Main Menu>Quick Menu>Options>Input>“Advanced>Automatic Game Pad Mappings” because that’s where I found that option. I didn’t see a core options except "Manage Core Options and only had the feature of saving my settings.

Sadly it didn’t work, random keys are still being assigned to my joystick so when I press a button on my joystick it does things it’s not supposed to do. The game only knows two buttons and movement but I assign keys with a program called “AntiMicroX” however even with that program off it still assigns keys to my joystick I don’t want assigned.

EDIT: I can remove the other gamepad from my “bluetooth & other devices” section of my settings and things work just fine when it’s just my joystick connected. I can then restart my computer and both game controllers will work.

I’m currently unable to do stuff, as I am restructuring my entire setup.

No, that is the setting from RetroArch, right? I think what I meant was running DOSBox-pure and change settings from the core.

Otherwise it could really be just the problem I talked about in my first reply in this thread. In example you have a gamepad that is assigned to player 1. In RetroArch you happily change the button config for it. Later you plugin another gamepad and if it gets higher priority in the system, then it might be player 1 now. And then you have the mess.