Page 1 of 1

Make on_gui_confirmed work for text-boxes

Posted: Wed Jul 17, 2019 7:34 pm
by Therenas
As far as I can tell, on_gui_confirmed does not fire on text-boxes at all. It would be useful to have it work on them, too, for obvious reasons.

Now the problem this poses is that the enter-key is overloaded in a text-box: It either performs a line return, or confirms the form. In other places (the web or others), this is solved by ctrl/shift and enter either confirming the form or inserting a line return, with enter doing the reverse. I'm not sure which solution is the correct one here, probably modifier-key and enter being the confirmation.

Another solution that might be fitting here is to let the modder decide. As the event communicates which modifier keys have been pressed along with enter, the mod itself could choose which combination of keys does what. This is more work for the modder, and might be confusing to users to have different interactions in different places, but it is an option, as is gives the most flexibility.

Re: Make on_gui_confirmed work for text-boxes

Posted: Thu Jul 18, 2019 10:17 am
by Rseding91
on_gui_confirmed can't work with text boxes because enter is already reserved for adding newlines to the text box.

Re: Make on_gui_confirmed work for text-boxes

Posted: Thu Jul 18, 2019 10:56 am
by Therenas
... That's what I wrote about, wanting to come up with a solution to that. But if it's not something you want to support, that's fine too.