Page 1 of 1

player.set_shortcut_toggled should be able to trigger the associated_control_input

Posted: Mon Oct 11, 2021 5:42 pm
by snouz
Currently, LuaPlayer.set_shortcut_toggled can only set the button toggled, but not actually trigger the custom-input linked by shortcut.associated_control_input.

WHAT

- adding a third optional bool parameter to set_shortcut_toggled to trigger or not the shortcut's associated_control_input
OR BETTER (to not break compatibility)
- adding a new function to LuaPlayer to trigger a specific shortcut or custom-input

WHY

As far as I know, there's no way to trigger a custom-input by script. The only way is to actually press the keys.

What I'd do with it
I'm developing GUI Unifyer, I want to create optional buttons in the top left for mods that only have shortcuts. I don't have access to the other mods functions, so I can't trigger their effect directly. My hope was to trigger it through the shortcut or custom-input, without having to rely on often non-existant remote interfaces.