[2.1.11] "confirm-gui" custom input fires when confirming with keyboard, but not with mouse.

Bugs that are actually features.
MeteorSwarm
Inserter
Inserter
Posts: 28
Joined: Thu Sep 25, 2025 10:49 pm
Contact:

[2.1.11] "confirm-gui" custom input fires when confirming with keyboard, but not with mouse.

Post by MeteorSwarm »

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:

Code: Select all

data:extend {{ 
    type = "custom-input",
    name = "confirm-gui",
    key_sequence = "",
    linked_game_control = "confirm-gui"
},
}

In control:

Code: Select all

local function on_click(event)
   game.print("confirm-gui")
    
  
 end


end

script.on_event("confirm-gui", on_click)
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.
Rseding91
Factorio Staff
Factorio Staff
Posts: 17240
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.1.11] "confirm-gui" custom input fires when confirming with keyboard, but not with mouse.

Post by Rseding91 »

Thanks for the report however this is not a bug. Custom inputs are linked to the specific key sequence and mouse clicks are not what that key sequence is bound to.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Not a bug”