To reproduce: Create a mod that adds a custom input tracking "confirm-gui."
In data:
Code: Select all
data:extend {{
type = "custom-input",
name = "confirm-gui",
key_sequence = "",
linked_game_control = "confirm-gui"
},
}
Code: Select all
local function on_click(event)
game.print("confirm-gui")
end
end
script.on_event("confirm-gui", on_click)Because confirming via gui does the same thing in the vanilla game, whether done with keyboard or mouse, the "confirm-gui" linked-input custom event should also fire in either situation.
This event is relevant to the Rigor module mod, which I am trying to optimize. The final remaining piece of on_tick scripting involves checking for when the player changes the recipe of assembling machines. It's likely possible to use the "build" event to capture mouse clicks for now, but if the player changes controls to use something other than the mouse's left-click button to build, this workaround will stop working.
Edit: The "build" event does not capture mouse clicks on buttons. There is now no known workaround.

