Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Need help implementing button labels #442

Open
hzulla opened this issue Jun 5, 2018 · 4 comments
Open

Feature Request: Need help implementing button labels #442

hzulla opened this issue Jun 5, 2018 · 4 comments

Comments

@hzulla
Copy link

hzulla commented Jun 5, 2018

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.

newbuttons

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" }
};
@dankcushions
Copy link
Member

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)

@lostless
Copy link

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

@dankcushions
Copy link
Member

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!

@Jaffacakelover
Copy link

Jaffacakelover commented Jan 11, 2021

I've put in a pull request for a few more console-specific button graphics (Triggers mainly):
#723

sylt added a commit to sylt/EmulationStation that referenced this issue Aug 21, 2022
Before this commit, all buttons shown in the help component would use
the SNES layout, which wouldn't match when having plugged in an Xbox
or Sony Playstation controller.

If there are different kinds of controllers plugged in, the input
mapping shown will be of the last used or inserted.

The intention here is to help solving RetroPie#442, or at least most of it.
sylt added a commit to sylt/EmulationStation that referenced this issue Aug 21, 2022
Before this commit, all buttons shown in the help component would use
the SNES layout, which wouldn't match when having plugged in an Xbox
or Sony Playstation controller.

If there are different kinds of controllers plugged in, the input
mapping shown will be of the last used or inserted.

The intention here is to help solving RetroPie#442, or at least most of it.
sylt added a commit to sylt/EmulationStation that referenced this issue Nov 28, 2022
Before this commit, all buttons shown in the help component would use
the SNES layout, which wouldn't match when having plugged in an Xbox
or Sony Playstation controller.

If there are different kinds of controllers plugged in, the input
mapping shown will be of the last used or inserted.

The intention here is to help solving RetroPie#442, or at least most of it.
sylt added a commit to sylt/EmulationStation that referenced this issue Nov 29, 2022
Before this commit, all buttons shown in the help component would use
the SNES layout, which wouldn't match when having plugged in an Xbox
or Sony Playstation controller.

If there are different kinds of controllers plugged in, the input
mapping shown will be of the last used or inserted.

The intention here is to help solving RetroPie#442, or at least most of it.
sylt added a commit to sylt/EmulationStation that referenced this issue Dec 3, 2022
Before this commit, all buttons shown in the help component would use
the SNES layout, which wouldn't match when having plugged in an Xbox
or Sony Playstation controller.

If there are different kinds of controllers plugged in, the input
mapping shown will be of the last used or inserted.

The controller identification is done via the SDL gamecontrollerdb,
where it's possible to supply the database through a text file. This
makes it possible to identify the latest game controllers without
having to update libSDL itself.

The intention here is to help solving RetroPie#442, or at least most of it.
sylt added a commit to sylt/EmulationStation that referenced this issue Dec 4, 2022
Before this commit, all buttons shown in the help component would use
the SNES layout, which wouldn't match when having plugged in an Xbox
or Sony Playstation controller.

If there are different kinds of controllers plugged in, the input
mapping shown will be of the last used or inserted. The controller
identification is done via the SDL gamecontroller API.

The intention here is to help solving RetroPie#442, or at least most of it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants