Creating hotkey alternates for multiple controllers

I am currently able to do this. I have an Xbox One controller, N30Modkit and SN30Modkit.

Step 1: Delete hotkey settings

In retroarch.cfg look for:

input_enable_hotkey

You will find multiple inputs with hotkey in them. Simply type/replace what is in the quotes with nul:

input_enable_hotkey = "nul"
input_enable_hotkey_axis = "nul"
input_enable_hotkey_btn = "nul"
input_enable_hotkey_mbtn = "nul"

Next, search for:

input_autodetect_enable 
input_remap_binds_enable 

and change them to :

input_autodetect_enable = "true"
input_remap_binds_enable = "true"

In [ retroarch > settings > input > user1binds ] you will know autoconfig is working because binds will show: “Auto: Button” for all of the buttons configured. If you don’t see “Auto: Button” then in that same menu select “User1BindDefaultAll”.

Step 2: Creating autoprofiles

Next, in “_parent/autoconfig/xinput” folder I have two cfg files which were created by retroarch. In order to keep it clean i deleted everything else from this folder. If you don’t have these cfg files, we will create them.

XBOX One Controller (User 1).cfg
XInput Controller (User 1).cfg (M30modkit/SN30modkit)
  1. Connect only the controller you wish to configure first.
  2. Launch retroarch.
  3. Go to Settings > Input > User1Binds
  4. Bind the controller to your liking
  5. When finished, select “User1SaveAutoconfig”. (This will create the cfg file)
  6. Select “User1BindDefaultAll”. You should now see “Auto: Button” for your buttons, this means autoconfig is working.
  7. Exit retroarch and disconnect controller. Connect the next controller to configure and repeat.

I discovered that the XInput Controller (User 1).cfg profile works for both the N30 and SN30 so it is only necessary to configure the SN30 first.

Step 3: Multiple hotkeys

In “_parent/autoconfig/xinput” folder edit the cfg files and add:

input_enable_hotkey_btn = "button_listed_in_cfg"

Xbox One example:

input_enable_hotkey_btn = “8” #Left Thumb button

N30/SN30 example:

input_enable_hotkey_btn = “7” #Select Button

The issue i am having which I am hoping someone here can help me out with. When assigning select or start buttons as a hotkey, that button will no longer function in some games on NES/SNES/Gameboy etc. For example if I assign the start button as the hotkey, the start button no longer works in Super Metroid for SNES but it will in other SNES games. Same issue with using select for example in Link’s Awakening for gameboy, the select no longer functions when using the hotkey.

It is my understanding that whatever button you assign as the hotkey on the controller, it will block the original command and be overwritten as a hotkey only. If only there was the option to allow a slight delay when pressing assigned hotkey button to first trigger the in-game command and then begin the hotkey call.

Huh.

I had thought that both functions activated simultaneously, so that the select key still works but the very rare select+ combo won’t (the Final Fantasy I map on NES as an example).

Hi again.

If I understood the instructions correctly, I already have Xinput and XB1 config files created by Retroarch installation.

I then tried entering:

input_enable_hotkey_btn = “7”

in XInput_Controller_User_1.cfg but get no change. I’ve tried testing this by adding:

input_menu_toggle_btn = “11”

(the start button) to the config file, but holding down select then start while in-game did nothing. The only place I can get it to work is by assigning it directly in Retroarch which edits the retroarch.cfg file. And that’s what I’m trying to avoid as it forces button 7 to be the universal hotkey enable button when I want one for XB1 and another for SN30.

Thanks for any further help. I might have misunderstood something in your instructions.

Hm in retroarch.cfg make sure these are set to true:

input_autodetect_enable = "true"
input_remap_binds_enable = "true"

In [retroarch > settings > input > user1binds] you will know autoconfig is working because binds will show: “Auto: Button” for all of the buttons configured. If you don’t see “Auto: Button” then in that same menu select “User1BindDefaultAll”.

Both are indeed set to true.

However, there’s something interesting going on in the user1 binds section. I don’t see auto: button, but it’s currently set to device index set to disabled with button assignments all set to the default keyboard keys. I thought that was the default behavior rather than auto: button on all the assignment settings.

The odd part is that I have Retroarch auto-detecting my Mayflash wiimote dolphinbar as four different devices, all with a higher priority (‘ports 1-4’) than any controller I turn on. Earlier I had forced User 1 settings over to the controller. The dolphin bar is set to the same setting I was last using Retroarch on and wasn’t causing any problems. Perhaps I had eliminated it from Retroarch (I use Dolphin directly rather than as a libretro core) somehow last time and those four devices are causing shenanigans. Could that be true?

In any case, I also don’t see anything change when I recycle the user1 bind default all option.

Housekeeping: I decided to start a new topic about the Mayflash devices here:

Hello again, so we appear to have the same configuration because I also have the Mayflash wiimote dolphinbar, SN30, XB1 controllers. I usually don’t leave my dolphinbar connected though so I attempted to do so now and this is what i discovered.

1

2

Backup your autoconfig folder if you wish and delete all other folders and cfg files within autoconfig leaving only the ones shown on these screenshots. (basically we leave mayflash unconfigured)

When I run retroarch, it says “Mayflash wiimote PC adapter not configured” 4 times for each detected port. If i go into my input settings I am able to see my xbox or SN30 device buttons detected from my autoconfig. Running a game works fine as well. The only annoyance with this is that retroarch keeps popping up with that message saying Mayflash isn’t configured.

If none of this fixes your problem I suggest backing up your retroarch.cfg, autoconfig folder and start “clean” (delete retroarch.cfg, autoconfig folder) and then follow my guide above again as a process of elimination to see where the problem might be in a configuration somewhere.

Note: Keep in mind when I first started this configuration I noticed that retroarch already had the XInput and XBOX One cfg files in the autoconfig folder but they did not have the correct id corresponding to my controllers, creating the autoconfig as shown in my guide from scratch assigns the correct id.

3

4

Ah. Ok, I think it worked. I’ll follow up if I get everything else set up.

Here’s where we were differing. I use the controller in Android mode (one blink), not Windows mode (two blinks). When you do that, which I think is the assumption of the autoconfig contributors, it requires the use of 8Bitdo_SN30_BT.cfg. That seems to do the trick.

In Retroarch, all the correct assignments show up in the hotkey menu and, more importantly, do not show up in retroarch.cfg. That tells me it’s reading the device config correctly.

Well shoot. I edited the config file, but the hotkey assignment isn’t working. For reference, these are the entries I’ve made in the device config:

  • input_enable_hotkey_btn = “10”
  • input_load_state_axis = “-1”
  • input_save_state_axis = “+1”
  • input_state_slot_decrease_axis = “-0”
  • input_state_slot_increase_axis = “+0”
  • input_menu_toggle_btn = “11”
  • input_exit_emulator_btn = “3”
  • input_menu_toggle_gamepad_combo = “nul”

Unfortunately, the buttons seem to be always on and not correctly enabled by the hotkey enable button. Not sure why.

edit: I went back to double check and yes. If I directly set the hotkeys within retroarch the hotkey toggle works correctly. If I write the above lines into the autoconfig file, the toggle does not work and the buttons inappropriately execute the hotkey function with every press.

Does the hotkeys button say “Auto”? This will make it use the autoconfig setting. Any button that shows up as “auto” in retroarch means it is set to null in the retroarch.cfg and will need to be assigned in the autoconfig cfg file for the controller.

Retroarch > Settings > Hotkey Binds > Hotkeys : Auto:Button

In the guide i posted above I described setting the hotkeys to null in the retroarch.cfg.

input_enable_hotkey = "nul"
input_enable_hotkey_axis = "nul"
input_enable_hotkey_btn = "nul"
input_enable_hotkey_mbtn = "nul"

It sure does. And all four enable lines are set to nul in retroarch.cfg.

I’m trying to think through the problem again this morning and still feel I don’t have enough information to deal with it properly quite yet. My assumption is that retroarch.cfg is the base configuration. However, device autoconfig files aren’t a pure override. They can’t be, right? Because otherwise you wouldn’t be telling me to leave the hotkey enable button blank on retroarch.cfg. So I assume that autoconfig files only assign bindings where bindings are previously blank. I have that correct, no?

And I’m also assuming that there’s no other intermediary file loaded between retroarch.cfg and autoconfigdevice.cfg.

The hotkey enable button is being assigned; I see the proper number (select = 10 for the SNES BT controller in android mode) with the ‘auto’ prefix in Retroarch. It just doesn’t work right.

So from my point of view:

  • There’s a normal behavior or prioritization that I don’t yet understand.
  • There’s a bug.
  • I could try switching the controller to windows mode, in which case I assume the xinput config file would load as it does for you and see if hotkey enable works correctly.

The autoconfig files can be downloaded from the retroarch > Online Updater for known controllers that either the libretro team provided or users submitted in order to create a working out of box experience as listed here https://github.com/libretro/retroarch-joypad-autoconfig. No need to configure the controllers or at least that is the intention. In some scenarios such as myself or others, the controller id within the provided autoconfig files don’t match with our controllers so it becomes necessary to create custom autoprofiles as we are attempting here. Is your 8Bitdo_SN30_BT.cfg provided by retroarch or did you create it using the guide above?

When you don’t have autoconfig files, you setup the controller through Settings > Input > User1Binds but if you don’t select “User1SaveAutoConfig”, it will only save to the retroarch.cfg. So yes even if you do have the autoconfig files, retroarch will first load the input assignments within retroarch.cfg and then the autoprofile. Leaving the input as null within retroarch.cfg makes certain that retroarch uses the autoprofile instead. Another scenario is if you are using core overrides (remap files for input) in which case will bypass the autoconfig and retroarch.cfg but you did not mention if you were using that option.

For your 8Bitdo controller are you using a 8bitdo retro / usb receiver or are you using bluetooth? My current setup is using the former since I don’t have a bluetooth adapter (unless there is a way to run bluetooth mode through the retro adapter I haven’t been able to).

I think you might be misunderstanding. The only things I changed on the autoconfig file were the hotkey assignments. Everything else I left as-is. Actually, I created the N30 and SN30 files incl. ID for submission, but someone beat me to it while I was traveling.

Let me link a pastebin of the file so you can see what I did. Again, to configure the device using that cfg file, the controller needs to be in android mode (one blink per second while pairing).

https://pastebin.com/jgEGtZm6

And for good measure, here’s the contents of the autoconfig.cfg:

https://pastebin.com/W653VV5q

The autoconfig file appears correct. My original question probably wasn’t clear, i was inquiring about the method you are using to connect your 8bitdo to your device (built in bluetooth, bluetooth dongle, 8bitdo adapter).

Using the retroarch.cfg file you provided, my controller would not be detected. Your input joypad assignments are wrong.

input_player1_joypad_index = "4"
input_player2_joypad_index = "5"
input_player3_joypad_index = "6"
input_player4_joypad_index = "6"
input_player5_joypad_index = "6"
input_player6_joypad_index = "5" 

etc etc

Change to:

input_player1_joypad_index = "0"
input_player2_joypad_index = "1"
input_player3_joypad_index = "2"
input_player4_joypad_index = "3"
input_player5_joypad_index = "4"
input_player6_joypad_index = "5"

After making these changes to your retroarch.cfg, the buttons show up as “auto” and works (hotkey works along with assignments).Hopefully this works for you.

Update: Maybe i was premature but I won’t know until you follow-up. This worked for me but I am wondering if “4” is the correct joypad on yours. Something else to keep in mind which is important:

If both my XB1 controller and SN30 controller are connected at once, retroarch will always assign whichever device is first in the priority from windows it seems. For example let’s say i want to use the XB1 controller. I turn off the SN30 controller (8bitdo dongle still connected to PC) and run retroarch. Retroarch will still detect the SN30 controller and assign it as joypad index 0 (player 1) in my case and the Xb1 won’t be assigned player 1 but instead player 2. To get around this issue what I end up doing is simply disconnecting the SN30 dongle to give the XB1 controller priority in retroarch. I know there is a program that changes the priority order of usb devices but I have not looked too much into it.

Update 2: Side note, looking over your autoconfig.cfg for the SN30 you might want to try these if the ones you have don’t work for the d-pad.

input_up_axis = 
input_down_axis = 
input_left_axis = 
input_right_axis = 

to

input_l_x_plus_axis = 
input_l_x_minus_axis = 
input_l_y_plus_axis = 
input_l_y_minus_axis =

Thanks. I’ll get back to you when I can try these things.

Update: Heeeey the hotkey works properly now. The device loads before the four dolphin devices fail to load. Some setting in them must have preempted this from working properly. I’ll check back in after I figure out and configure the XB1 and NES controllers.

Ok, I’m almost there. I’ve got both the controllers working properly, however they do not exchange control between one another correctly (ie-starting Retroarch with a different controller turned on). I have to go into user 1 binds to switch the controller. This ought to happen automatically.

I tried using a copy of retroarch.cfg from a fresh download of the program. No change.

The current relevant files.

retroarch.cfg: https://pastebin.com/uQFMJZ4B

XBox_One_Controller_Wireless_Adapter.cfg: https://pastebin.com/ss9JSYj8

8Bitdo_SN30__BT.cfg: https://pastebin.com/3L7f61NS

I asked this before for exactly this scenario but have not received a response, what method(receiver) are you using to connect your 8bitdo SN30 to Windows? (8bitdo usb adapter, bluetooth USB dapater, built-in bluetooth).

In order to relinquish control from the 8bitdo, you would have to disconnect the adapter and not just turning off the controller. The xbox one controller is the exception, you can simply turn off the controller without disconnecting the receiver and it will relinquish control (unless you are also connecting the XB1 controller via bluetooth to windows). This is not practical but attempt to do this first so we can make sure the autoprofile switch is working properly

Testing Xbox controller

  1. Disconnect 8bido adapter, turn off SN30 controller
  2. Turn on Xbox controller
  3. Run retroarch and test Xbox controller

and then

Testing SN30 Controller

  1. Turn off Xbox One Controller
  2. Connect 8bitdo adapter, Turn on SN30 Controller
  3. Run retroarch and test SN30 Controller

Assuming this works, you will be at the same point I am at. I am still trying to figure out how to switch controllers without disconnecting the receivers or turning off controllers.

Ah, had forgotten. Bluetooth is integrated into the motherboard. I suppose I could test the theory by disabling the radio itself and see if control transfers back and forth correctly.