[2.1.11] "confirm-gui" custom input fires when confirming with keyboard, but not with mouse.
Posted: Sun Jul 19, 2026 10:30 pm
When adding a custom input tracking "confirm-gui" inputs, GUI confirmations done via keyboard are captured, while GUI confirmations done via mouse are not captured.
To reproduce: Create a mod that adds a custom input tracking "confirm-gui."
In data:
In control:
Load this mod in-game. Enter cheat mode, and place an assembling machine. Attempt to set the machine's recipe, once confirming with the keyboard, once with the mouse. Confirming with the keyboard will cause the game to print "confirm-gui". Confirming with the mouse will not cause that to happen.
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.
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.