[2.0.69] Custom input linked to `undo` game action doesn't fire on undo GUI shortcut
Posted: Sat Oct 04, 2025 5:46 pm
Reproduction steps:
1) Add the following prototype in data phase:
2) In control phase, monitor when the above custom input fires, e.g.
3) Enter game and push 2 entries to the undo stack, e.g. by building 2 entities.
4) Push undo keybind (eg CTRL+Z) to undo the second entry
5) Push undo GUI button to undo the first entry
Actual result:
Pushing CTRL+Z will result in the event being fired. Pushing the undo GUI button will not fire the event.
Expected result:
Since in both cases the "undo" game action was triggered, the event should have fired in both cases.
1) Add the following prototype in data phase:
Code: Select all
data:extend({
{
type = "custom-input",
name = "things-linked-undo",
key_sequence = "",
linked_game_control = "undo",
},
})
Code: Select all
script.on_event("things-linked-undo", function() game.print("event fired") end)
4) Push undo keybind (eg CTRL+Z) to undo the second entry
5) Push undo GUI button to undo the first entry
Actual result:
Pushing CTRL+Z will result in the event being fired. Pushing the undo GUI button will not fire the event.
Expected result:
Since in both cases the "undo" game action was triggered, the event should have fired in both cases.