Ok, I got autoconfigure to work on PC. There were some refactors to input which aren’t fully tested yet, so I pushed it to a branch for now.
https://github.com/Themaister/RetroArch/tree/joypad-autoconfig
It only works on Linux (with linuxraw driver) for now.
Idea:
# Enable input auto-detection. Will attempt to autoconfigure
# joypads, Plug-and-Play style.
# input_autodetect_enable = true
# Directory for joypad autoconfigs (PC).
# If a joypad is plugged in, that joypad will be autoconfigured if a config file
# corresponding to that joypad is present in joypad_autoconfig_dir.
# Input binds which are made explicit (input_playerN_*_btn/axis) will take priority over autoconfigs.
# Autoconfigs can be created with retroarch-joyconfig, manually, or with a frontend.
# Requires input_autodetect_enable to be enabled.
# joypad_autoconfig_dir =
Promoted input_autodetect_enable setting from Android.
Here’s an example autoconfig, xbox-wireless.cfg:
input_device = "Xbox 360 Wireless Receiver"
input_driver = "linuxraw"
input_b_btn = "0"
input_y_btn = "2"
input_select_btn = "6"
input_start_btn = "7"
input_up_btn = "13"
input_down_btn = "14"
input_left_btn = "11"
input_right_btn = "12"
input_a_btn = "1"
input_x_btn = "3"
input_l_btn = "4"
input_r_btn = "5"
input_l2_axis = "+2"
input_r2_axis = "+5"
input_l3_btn = "9"
input_r3_btn = "10"
input_l_x_plus_axis = "+0"
input_l_x_minus_axis = "-0"
input_l_y_plus_axis = "+1"
input_l_y_minus_axis = "-1"
input_r_x_plus_axis = "+3"
input_r_x_minus_axis = "-3"
input_r_y_plus_axis = "+4"
input_r_y_minus_axis = "-4"
You can add other binds as well if you want (–misc in joyconfig for one).
There’s only input as prefix, and not input_playerN since it’s player-agnostic (only cares about joypad itself).
I added some functionality to retroarch-joyconfig so it can create these autoconfigs.
retroarch-joyconfig --autoconfig /autoconfig/folder/pad.cfg -j joypad_index
I also added some “fixes” to joyconfig. Now you’ll be prompted first to clear out state before you start initial poll.
Some pads/drivers are kinda ugly here and start with garbage state …
Found joypad driver: linuxraw
Using joypad: Xbox 360 Wireless Receiver
Joypads tend to have stale state after opened.
Press some buttons and move some axes around to make sure joypad state is completely neutral before proceeding.
When done, press Enter ...
You should see an on-screen message in RetroArch when autoconfigure goes right (and in regular log).