player.set_shortcut_toggled should be able to trigger the associated_control_input

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
snouz
Inserter
Inserter
Posts: 27
Joined: Sun Jan 03, 2021 6:01 pm
Contact:

player.set_shortcut_toggled should be able to trigger the associated_control_input

Post 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.
Graphically contributed to : Bio Industries (soon) | Warehousing | MFerrari's mods | Brevven's mods | Bob Artisanal Reskins | Mining Drones | Teleporters | Emoji signals
Post Reply

Return to “Modding interface requests”