Skip to content

Commit 8a8a234

Browse files
authored
Merge pull request #966 from davidhedlund/patch-10
docs/controller-autoconfiguration.md: Added a new "Controller name scheme" section
2 parents a91d79a + 6feb689 commit 8a8a234

File tree

1 file changed

+83
-2
lines changed

1 file changed

+83
-2
lines changed

docs/guides/controller-autoconfiguration.md

+83-2
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,56 @@ Here's how to set up a default-off configuration:
157157
3. Do not add "(default-off)" to the values of the input_device_display_name and input_driver variables in the config file. The default-off status is already indicated by the filename, so these variables should remain unmodified for clarity.
158158

159159
This approach allows users to manually enable the configuration when needed, preventing automatic application that could interfere with common devices, and helps ensure a smoother experience for users while still providing the necessary configuration options for those who require them.
160-
160+
161+
### Controller name scheme
162+
163+
In RetroArch, the management of controller configurations is essential for ensuring proper functionality across various systems. This guide outlines how controller names are generated and how they can vary based on the Linux kernel version in GNU/Linux distributions.
164+
165+
#### Understanding controller names
166+
167+
When you save a controller profile (**Settings > Input > RetroPad Binds > Port 1 Controls > Save Controller Profile**), RetroArch generates a controller name (e.g., "Foo"). This name serves two purposes:
168+
169+
1. It becomes part of the configuration file name (e.g., "udev/Foo.cfg").
170+
2. It's used as the value for the `input_device` variable within the configuration file (e.g., `input_device = "Foo"`).
171+
172+
Importantly, this name remains consistent across various controller drivers, such as udev, sdl2, and linuxraw, as specified in **Settings > Drivers > Controller**.
173+
174+
#### Variability of controller names
175+
176+
The controller name may change depending on the version of the system, particularly the Linux kernel version. To ensure compatibility, we utilize the most recent controller name that is supported by the system.
177+
178+
#### Example: Nintendo Switch Pro Controller on GNU/Linux
179+
180+
The following table illustrates how the controller name for the Nintendo Switch Pro Controller varies across different Linux kernel versions, along with its HID support and corresponding autoconfig file names. As a side-note, the notation "(default-off)" indicates that the configuration is disabled by default to avoid
181+
182+
| Linux Kernel Version | Controller Name in RetroArch | Nintendo Switch Pro Controller HID Support | Selected controller name for the autoconfiguration file |
183+
|----------------------|-------------------------------------------|-------------------------------------------|----------------------------------------------|
184+
| 5.15 | Pro Controller | No | Pro Controller |
185+
| 5.19 | Nintendo Switch Pro Controller | Yes | |
186+
| 6.2.0 | Nintendo Switch Pro Controller | Yes | |
187+
| 6.8.0 | Nintendo Co., Ltd. Pro Controller | Yes | Nintendo Co.,Ltd. Pro Controller |
188+
189+
##### Configuration file examples
190+
191+
###### Pro Controller (default-off).cfg
192+
```
193+
# This file uses the legacy controller name "Pro Controller" (generated by RetroArch on Linux 5.15)
194+
# "(default-off)" was added to the file name to indicate that the autoconfig file is not active by default. See comments for input_vendor_id and input_product_id.
195+
input_device = "Pro Controller"
196+
# Due to the uncommon nature of this device, the autoconfig file is not active by default. This precaution is taken to avoid potential conflicts with the widely-used Nintendo Switch Pro Controller (nintendo-hid version) file. Button layouts are not compatible. To activate this configuration:
197+
# 1) Comment out the input_vendor_id and input_product_id lines in the "Nintendo Co.,Ltd. Pro Controller.cfg" file.
198+
# 2) Uncomment the input_vendor_id and input_product_id lines below:
199+
# input_vendor_id = "1406"
200+
# input_product_id = "8201"
201+
```
202+
203+
###### Nintendo Co.,Ltd. Pro Controller.cfg
204+
```
205+
input_device = "Nintendo Co.,Ltd. Pro Controller"
206+
input_vendor_id = "1406"
207+
input_product_id = "8201"
208+
```
209+
161210
## Troubleshooting
162211
If your joypad is not configured properly, you should [generate a RetroArch log](/docs/guides/generating-retroarch-logs.md). Your log will show if a profile has been matched for your pad and the path of the corresponding profile.
163212

@@ -227,8 +276,9 @@ input_menu_toggle_btn = "8"
227276

228277
### Input descriptors
229278

230-
The third part are *input descriptors* used by RetroArch to display the labels of the buttons as they are written on your joypad. So if you are using a DualShock pad, RetroArch will refer to the buttons as Cross, Circle, Square and Triangle.
279+
The third part are *input descriptors* used by RetroArch to display the labels of the buttons as they are written on your joypad.
231280

281+
Generic input descriptors:
232282
```
233283
input_b_btn_label = "A"
234284
input_y_btn_label = "X"
@@ -256,3 +306,34 @@ input_r_y_plus_axis_label = "Right Analog Y+ (down)"
256306
input_r_y_minus_axis_label = "Right Analog Y- (up)"
257307
input_menu_toggle_btn_label = "Guide"
258308
```
309+
310+
#### Sony PlayStation controllers
311+
312+
So if you are using a Sony PlayStation controllers, RetroArch will refer to the buttons as Cross, Circle, Square and Triangle:
313+
```
314+
input_b_btn_label = "Cross"
315+
input_y_btn_label = "Square"
316+
input_select_btn_label = "Create"
317+
input_start_btn_label = "Options"
318+
input_up_btn_label = "D-Pad Up"
319+
input_down_btn_label = "D-Pad Down"
320+
input_left_btn_label = "D-Pad Left"
321+
input_right_btn_label = "D-Pad Right"
322+
input_a_btn_label = "Circle"
323+
input_x_btn_label = "Triangle"
324+
input_l_btn_label = "L1"
325+
input_r_btn_label = "R1"
326+
input_l2_axis_label = "L2"
327+
input_r2_axis_label = "R2"
328+
input_l3_btn_label = "L3"
329+
input_r3_btn_label = "R3"
330+
input_l_x_plus_axis_label = "Left Analog X+ (right)"
331+
input_l_x_minus_axis_label = "Left Analog X- (left)"
332+
input_l_y_plus_axis_label = "Left Analog Y+ (down)"
333+
input_l_y_minus_axis_label = "Left Analog Y- (up)"
334+
input_r_x_plus_axis_label = "Right Analog X+ (right)"
335+
input_r_x_minus_axis_label = "Right Analog X- (left)"
336+
input_r_y_plus_axis_label = "Right Analog Y+ (down)"
337+
input_r_y_minus_axis_label = "Right Analog Y- (up)"
338+
input_menu_toggle_btn_label = "PS"
339+
```

0 commit comments

Comments
 (0)