-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autoconfig extension with alternative name/vid/pid (#16990)
If there are several variants of a controller, but their button layout is exactly the same, allow alternative identifiers, e.g.: input_device_alt1 input_vendor_id_alt3 input_product_id_alt9
- Loading branch information
Showing
4 changed files
with
130 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
input_driver = "test" | ||
input_device = "Test joypad device D" | ||
input_vendor_id = 1 | ||
input_product_id = 2 | ||
input_device_alt1 = "Test joypad device E" | ||
input_device_alt8 = "Test joypad device F" | ||
input_vendor_id_alt8 = 21 | ||
input_product_id_alt8 = 22 | ||
input_device_display_name = "Test joypad device D/E/F" | ||
input_b_btn = "0" | ||
input_y_btn = "1" | ||
input_select_btn = "2" | ||
input_start_btn = "3" | ||
input_up_btn = "4" | ||
input_down_btn = "5" | ||
input_left_btn = "6" | ||
input_right_btn = "7" | ||
input_a_btn = "8" | ||
input_x_btn = "9" | ||
input_l_btn = "10" | ||
input_r_btn = "11" | ||
input_l2_btn = "12" | ||
input_r2_btn = "13" | ||
input_l3_btn = "14" | ||
input_r3_btn = "15" | ||
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 = "+2" | ||
input_r_x_minus_axis = "-2" | ||
input_r_y_plus_axis = "+3" | ||
input_r_y_minus_axis = "-3" | ||
|
18 changes: 18 additions & 0 deletions
18
tests-other/test_input_joypad_alternative_autoconfig.ratst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[ | ||
{ | ||
"action": 1, | ||
"param_num": 0, | ||
"param_str": "(0001:0002) Test joypad device D", | ||
"frame": 0 | ||
}, | ||
{ | ||
"action": 1, | ||
"param_num": 1, | ||
"param_str": "(0003:0004) Test joypad device E" | ||
}, | ||
{ | ||
"action": 1, | ||
"param_num": 2, | ||
"param_str": "(0015:0016) Test joypad device X" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Test configuration file to be used with --appendconfig. | ||
# Sets up joypad driver, test input file for the joypad driver, | ||
# logging and autoconfig dir, and prevents saving. | ||
# Usage: | ||
# retroarch --appendconfig tests-other/testinput_alternative_autoconfig.cfg\|tests-other/all_binds_empty.cfg | ||
|
||
# Test scenario: | ||
# - A device is connected with autoconfig profile | ||
# - A second device is connected which matches autoconfig profile alt1 | ||
# - A third device is connected which matches autoconfig profile alt8 (only by vid/pid) | ||
# - VALIDATE: check that Player 1..3 have "Test joypad D/E/F" configured | ||
|
||
input_joypad_driver = "test" | ||
test_input_file_joypad = "tests-other/test_input_joypad_alternative_autoconfig.ratst" | ||
joypad_autoconfig_dir = "tests-other/autoconf" | ||
frontend_log_level = "0" | ||
libretro_log_level = "0" | ||
log_verbosity = "true" | ||
config_save_on_exit = "false" |