Here is a practical example of what I want to achieve, possible with a button:
winset(src, "[id].accept", "command=\".winset \\\"command=\\\"[accept_verb] \[\[[id].input.text as escaped\]\]\\\";[id].is-visible=false\\\"\"")
Instead, I was forced to use a simpler command and hide the window using winshow, which is delayed by ping:
winset(src, "[id].input", "command=\".winset [id].is-visible=false;\\\"command=\\\"[accept_verb]")
I have described my reasoning in this PR, which I also think is a good use-case for the feature: https://github.com/BeeStation/BeeStation-Hornet/pull/5417
Long story short:
Bee added typing indicators, which moved from running a verb with a text argument to an argumentless verb calling input(). Because of this, there is now a delay dependent on ping before the textbox opens.
To remove the delay, somebody suggested using macros and winset, so I went about implementing this. Opening the window without a delay while simultaneously invoking a verb is possible, allowing me to signal to the server that a typing indicator should be shown and open the textbox without a delay.
However, I ran into an issue - the Input has somewhat strict input validation when in command mode, but has no (documented) way to handle Enter keypresses in non-command mode.
Ideally, I want to hide the window as soon as Enter is pressed, using a clientside .winset. However, the command needs to be simple for the input validation to allow inputting spaces when in command mode. On the other hand, there seems to be no way to handle Enter while in non-command, forcing me to revert to a simple verb as the command on the Input.
The end result of this all is that I have to have the input delay when closing the window with enter if I want to remove the delay from opening the window.