[suggest] change how to map hotkeys in controller.cfg-files

I suggest a change on how to map hotkeys (input_enable_hotkey, input_menu_toggle, input_exit_emulator, …). Today mapping hotkeys refers directly to key/button/axis on the controller the same way the input_# is mapped.

Wouldn’t it be better to refer the hotkey mapping to the already mapped input_# key/button/axis? Maybe this would also make it possible to add hotkey mappings inside autocfg-files to have universal hotkey mappings in the main retroarch.cfg that works with mostly all controllers?

- example of toady’s custom controller.cfg-file:

input_enable_hotkey_btn = "21"input_menu_toggle_btn = "14"
input_exit_emulator_btn = "22"
input_save_state_btn = "15"
input_load_state_btn = "11"
input_slowmotion_btn = "18"
input_rewind_btn = "17"
input_hold_fast_forward_btn = "0"
input_disk_eject_toggle_btn = "5"
input_disk_next_btn = "3"
input_disk_prev_btn = "2"
input_screenshot_btn = "12"


input_device_p1 = "0"
input_player1_joypad_index = "0"
input_libretro_device_p1 = "1"
input_player1_analog_dpad_mode = "0"

input_player1_b_btn = "12"
input_player1_y_btn = "15"
input_player1_select_btn = "21"
input_player1_start_btn = "22"
input_player1_up_btn = "0"
input_player1_down_btn = "5"
input_player1_left_btn = "2"
input_player1_right_btn = "3"
input_player1_a_btn = "11"
input_player1_x_btn = "14"
input_player1_l_btn = "17"
input_player1_r_btn = "18"

- example of my suggested custom controller.cfg-file:

input_enable_hotkey = "input_select"
input_menu_toggle = "input_x"
input_exit_emulator = "input_start"
input_save_state = "input_y"
input_load_state = "input_a"
input_slowmotion = "input_r"
input_rewind = "input_l"
input_hold_fast_forward = "input_up"
input_disk_eject_toggle = "input_down"
input_disk_next = "input_right"
input_disk_prev = "input_left"
input_screenshot = "input_b"


input_device_p1 = "0"
input_player1_joypad_index = "0"
input_libretro_device_p1 = "1"
input_player1_analog_dpad_mode = "0"

input_player1_b_btn = "12"
input_player1_y_btn = "15"
input_player1_select_btn = "21"
input_player1_start_btn = "22"
input_player1_up_btn = "0"
input_player1_down_btn = "5"
input_player1_left_btn = "2"
input_player1_right_btn = "3"
input_player1_a_btn = "11"
input_player1_x_btn = "14"
input_player1_l_btn = "17"
input_player1_r_btn = "18"

- example of my suggested autocontroller.cfg-file:

input_device = "8Bitdo NES30 GamePad"
input_driver = "udev"
input_vendor_id = 10272
input_product_id = 9
input_b_btn = "12"
input_y_btn = "15"
input_select_btn = "21"
input_start_btn = "22"
input_up_btn = "0"
input_down_btn = "5"
input_left_btn = "2"
input_right_btn = "3"
input_a_btn = "11"
input_x_btn = "14"
input_l_btn = "17"
input_r_btn = "18"


input_b_btn_label = "B"
input_y_btn_label = "Y"
input_select_btn_label = "Select"
input_start_btn_label = "Start"
input_up_btn_label = "D-Pad Up"
input_down_btn_label = "D-Pad Down"
input_left_btn_label = "D-Pad Left"
input_right_btn_label = "D-Pad Right"
input_a_btn_label = "A"
input_x_btn_label = "X"
input_l_btn_label = "L"
input_r_btn_label = "R"

input_enable_hotkey = "input_select"
input_menu_toggle = "input_x"
input_exit_emulator = "input_start"
input_save_state = "input_y"
input_load_state = "input_a"
input_slowmotion = "input_r"
input_rewind = "input_l"
input_hold_fast_forward = "input_up"
input_disk_eject_toggle = "input_down"
input_disk_next = "input_right"
input_disk_prev = "input_left"
input_screenshot = "input_b"

I don’t think we want autoconfigs to go beyond mapping to the retropad abstraction. Including hotkey mappings in autoconfigs seems too tied to individual preferences (I may want menu or savestate or FF or whatever bound to L1, while someone else wants it bound to R3 or Home or whatever). In contrast, game buttons are essentially universal. Nobody really wants L1 mapped to R3.

My suggestion was a little unclear! What I tried to suggest was: Make it possible to map hotkeys to retropad, not only the actual controller. This way I can make a general hotkey mapping in retroarch.cfg that will work with all my controllers (except if hotkey mapping is defined in a custom controller.cfg-file), then the mappings will be the same for all my controllers.

  • example:

input_enable_hotkey = "retropad_select"
input_menu_toggle = "retropad_x"
input_exit_emulator = "retropad_start"
input_save_state = "retropad_y"
input_load_state = "retropad_a"
input_slowmotion = "retropad_r"
input_rewind = "retropad_l"
input_hold_fast_forward = "retropad_up"
input_disk_eject_toggle = "retropad_down"
input_disk_next = "retropad_right"
input_disk_prev = "retropad_left"
input_screenshot = "retropad_b"




input_device_p1 = "0"
input_player1_joypad_index = "0"
input_libretro_device_p1 = "1"
input_player1_analog_dpad_mode = "0"


input_player1_b_btn = "12"
input_player1_y_btn = "15"
input_player1_select_btn = "21"
input_player1_start_btn = "22"
input_player1_up_btn = "0"
input_player1_down_btn = "5"
input_player1_left_btn = "2"
input_player1_right_btn = "3"
input_player1_a_btn = "11"
input_player1_x_btn = "14"
input_player1_l_btn = "17"
input_player1_r_btn = "18"

Hi,

I thought it was already possible. Here

https://docs.libretro.com/guides/input-and-controls/

you read a tip like this

“Hotkeys can also be mapped to RetroPad buttons.”

So I tried to understand which is the retropad buttons value set to assign to hotkeys, but I did not found it

Did I misunderstood the tip, or did a retropad buttons value set exist?

The use case is using many types of controllers (Nvidia shield, XBox, Dualshock, Mayflash…) depending on the game being played and on the number of players. I would like to be able on each of them of accessing hotkeys and by the same way. Retropad is the abstraction of all the controllers for gaming, it should be the abstraction also for meta-gaming, or not?

Can retroarch developers do the trick? It will be very useful, I think

Thanks :slight_smile: