EmulationStation
EmulationStation copied to clipboard
Feature Request: Need help implementing button labels
If the east/south/north/west patch were accepted, the next iteration would be to include controller-specific button labels.
The idea is to let the user choose from common button label configurations (SNES / XBOX / PSX / etc.) and store this for the specific inputConfig. The HelpComponent icon display should then change the icons according to the button labels of the last used input device.
User presses SNES gamepad -> ABXY. User then picks up the PS3 gamepad which is also connected to Retropie -> Icons change to geometrical shapes.

Step 1 would be to add a label value to inputConfig and make HelpComponent use it.
<input name="a" label="circle" type="button" id="2" value="1" />
<input name="b" label="cross" type="button" id="1" value="1" />
<input name="x" label="triangle" type="button" id="3" value="1" />
<input name="y" label="square" type="button" id="0" value="1" />
Step 2 would be to make HelpComponent change the icons on the fly, based on the last used input device.
Step 3 would be to make the labels user-configurable. At the end of the input configuration for a device, GuiInputConfig could display some standard button label layout variations that the user can choose from.
static const int labelLayoutCount = 6;
static const char* BUTTON_LABEL_LAYOUT[labelLayoutCount][4] {
// Default / Retropad / SNES-button style
// x
// y a
// b
{ "a", "b", "x", "y" },
// XBOX style, a/b and x/y switched positions
{ "b", "a", "y", "x" },
// Sony PSX style, geometric icons
{ "circle", "cross", "triangle", "square" },
// Numbered buttons #1 (Dragonrise etc.)
{ "2", "3", "1", "4" },
// Numbered buttons #2 (Elecom etc.)
{ "4", "3", "2", "1" },
// Numbered buttons #3 (Logitech)
{ "3", "2", "4", "1" }
};
Yes, I like this!
If we got this done a future step could be that once a 'preset' (PSX,Xbox, etc) has been selected, or custom labels have been entered, we then populate them to the users autoconfig file that is normally generated by the input configuration.
for example:
input_b_btn_label = "Cross"
input_y_btn_label = "Square"
input_select_btn_label = "Select"
input_start_btn_label = "Start"
input_a_btn_label = "Circle"
input_x_btn_label = "Triangle"
https://github.com/libretro/retroarch-joypad-autoconfig/blob/master/udev/Sony-PlayStation3-DualShock3-Controller-USB.cfg#L31
this means that these button labels would also be visible in retroarch emulator menus, rather than the (potentially misleading) generic retropad button labels.
(perhaps the selection of the preset could be done during/before input configuration)
Dankcushions, thats a great idea. We don't necessarily need to label the controllers with the proper button names, but simple y(left), B(down) Ect would do just fine when ES makes a retroarch auto config file. It'll sure make editing button configs on retro arch 1.7.3 and up much easier to deal with
A thought about this - we wouldn't even need the user to select a button layout. when ES first discovers a controller (the initial bind), it would read the USB device description and:
if (strcasestr(deviceStr, "sony") != NULL)
{
// use psx buttons
}
else if (strcasestr(deviceStr, "microsoft") != NULL)
{
// use xbox buttons
}
else
{
// default to SNES/retropad standard
}
we should be able to catch most controllers with a method like this. for the rest, i think you'd have to configure the layout after the initial bind, because you need to know the binds for dpad + A/enter to select from a menu!
I've put in a pull request for a few more console-specific button graphics (Triggers mainly): https://github.com/RetroPie/EmulationStation/pull/723