RetroArch icon indicating copy to clipboard operation
RetroArch copied to clipboard

[feature request] Save Hotkeys to Autoconfig Profile

Open hizzlekizzle opened this issue 2 years ago • 11 comments

Description

Because hotkeys are a very personal preference, we specifically disallow any hotkeys from being assigned in autoconfig profiles except for the menu toggle on various pads' "home" buttons. However, many people who swap among multiple controllers want to have hotkeys available on their pads without constantly revisiting the hotkey menu to reassign them, since they're stored as static keycodes that may not be consistent across gamepads.

This comes up fairly often on the subreddit and I typically tell users to add the hotkey assignments to their autoconfig profile via a text editor, which works well, AFAIK. However,

I propose adding an option to "save hotkeys to autoconfig profile" (and probably would need a corresponding "reset hotkeys to default", as well) to settings > input > hotkeys so users can achieve this without needing to do it manually via text editor.

Expected behavior

Custom hotkeys that follow controllers around as you swap among them

Actual behavior

hotkeys are tied to the controller on which you set them

Steps to reproduce the bug

  1. plug in a pad
  2. set some hotkeys
  3. plug in another pad
  4. try to use those hotkeys

Bisect Results

always. it's normal behavior

Version/Commit

You can find this information under Information/System Information

  • RetroArch: 1.16.0

Environment information

  • OS: all
  • Compiler: any

@sonninnos , pinging you on this as the resident menu guru. Do you know of any technical dealbreakers on something like this?

hizzlekizzle avatar Jan 11 '24 20:01 hizzlekizzle

Seems like a worthy pursuit, and shouldn't be too complicated.

sonninnos avatar Jan 11 '24 23:01 sonninnos

  • https://github.com/libretro/RetroArch/issues/16115

davidhedlund avatar Jan 13 '24 12:01 davidhedlund

This comes up fairly often on the subreddit and I typically tell users to add the hotkey assignments to their autoconfig profile via a text editor, which works well, AFAIK.

@hizzlekizzle

This is not working for me. For example:

In a autoconfig/udev/SNES Controller.cfg file:

input_enable_hotkey_btn = "6"
input_exit_emulator_btn = "7"
input_load_state_btn = "5"
input_menu_toggle_btn = "2"
input_save_state_btn = "4"
input_shader_toggle_btn = "0"

The settings above will not be applied for my SNES controller. The hotkey settings configured on the global retroarch.cfg will be considered instead. What should I do?

abbluiz avatar May 16 '25 17:05 abbluiz

@abbluiz the above works for me on 1.20.0 / Win x64 with xinput as controller driver. please verify the active:

  1. controller driver via Settings / Driver (remember, input and controller driver are independent)
  2. autoconfig via Main Menu / Information / System Information

odditude42 avatar May 16 '25 19:05 odditude42

@odditude42 I managed to fix it by doing the following:

Changing all related hotkey variables to "nul" in the global retroarch.cfg. Example:

input_enable_hotkey_btn = "nul"
input_exit_emulator_btn = "nul"
input_load_state_btn = "nul"
input_menu_toggle_btn = "nul"
input_save_state_btn = "nul"
input_shader_toggle_btn = "nul"

And then change these values to whatever I need in the specific autoconfig file for each controller.

I'm on Linux (Fedora 42) using version 1.21.0 if anyone is having a similar issue.

abbluiz avatar May 16 '25 19:05 abbluiz

just echoing support for this.

Angstdiscord avatar May 27 '25 18:05 Angstdiscord

Super big thanks for pointing out how to do this, @abbluiz!

Is there a text-editor power-user hack-the-matrix way of changing hotkeys based on core, as well? For instance, on older systems, I like having L2 = Rewind and R2 = fast forward. But obviously, this can't work for PSX/DC, so it'd be nice to be able to juggle things. Is it as simple as adding the same lines to the .opt files in \config\corename\?

YutMarma avatar May 28 '25 13:05 YutMarma

No. opt files are for core options and thus can't take any frontend settings, cfg files are for frontend setting overrides.

sonninnos avatar May 28 '25 13:05 sonninnos

No. opt files are for core options and thus can't take any frontend settings, cfg files are for frontend setting overrides.

Ah, gotcha. So there's no way for frontend overrides to be set per-core? (or per-directory, or per-content for that matter...)

YutMarma avatar May 28 '25 23:05 YutMarma

Pretty sure there is: https://github.com/libretro/RetroArch/pull/14895

sonninnos avatar May 28 '25 23:05 sonninnos

This really saved my bacon, now that I have a Stadia controller to supplement my PS4/PS5 ones. The Stadia controller even has sufficient buttons so that I can avoid the hotkey enabler and just go for direct actions (menu/save-state/load-state).

aktau avatar May 29 '25 20:05 aktau