Make on_gui_confirmed work for text-boxes
Posted: Wed Jul 17, 2019 7:34 pm
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.
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.