on_gui_confirmed for textfields - works or does not?
Posted: Sat Nov 23, 2024 8:04 am
I have seen viewtopic.php?t=73372, which states "on_gui_confirmed can't work with text boxes because enter is already reserved for adding newlines to the text box."
However, there is https://lua-api.factorio.com/latest/eve ... _confirmed, which literally says "Called when a LuaGuiElement is confirmed, for example by pressing Enter in a textfield." and there is https://lua-api.factorio.com/latest/cla ... on_confirm which states "Whether this textfield loses focus after defines.events.on_gui_confirmed is fired."
However, I have yet to manage seeing the on_gui_confirmed event being fired from a text field in my code.
Am I doing something wrong? Is that documentation incorrect and the forum post correct? Are there any working code examples of "press <ENTER> in a text field, receive on_gui_confirmed event"?
Grateful for any pointers.
However, there is https://lua-api.factorio.com/latest/eve ... _confirmed, which literally says "Called when a LuaGuiElement is confirmed, for example by pressing Enter in a textfield." and there is https://lua-api.factorio.com/latest/cla ... on_confirm which states "Whether this textfield loses focus after defines.events.on_gui_confirmed is fired."
However, I have yet to manage seeing the on_gui_confirmed event being fired from a text field in my code.
Am I doing something wrong? Is that documentation incorrect and the forum post correct? Are there any working code examples of "press <ENTER> in a text field, receive on_gui_confirmed event"?
Grateful for any pointers.