Command line input
Command line input similar to Unix shell echo -n
and read
commands:
Comments (8)
-
reporter -
repo owner A
ReadInput
action is planned which would allow you to do the followingstring name yield return new ReadInput(s => name = s);
This isn’t _quite_ the same though as it would use the standard input field rather than being inline, which means it also wouldn’t support a non echo mode
Perhaps there’s a nice way to support this more directly too, but nothing crosses my mind yet
-
reporter
-
repo owner Hmm, so displaying extra text in the input field itself; certainly an interesting idea
-
reporter I think modifying the appearance of the input field makes it clear that its function has changed; it no longer processes commands.
Since data-entry fields typically have labels that are positioned left-of or above them, I placed the label left of it.
When I tried placing the rounded rectangle outside the input field, it looked too much like a button. Placing it in the field also makes it clearer that it’s related to the data field.
Alternative:
-
repo owner Agreed, personally I think the first mockup is much nicer.
With regards to the “get input“ API in general, perhaps the
QuantumConsole
could have a function of this naturevoid RequestInput(Action<string> onSubmit);
This would then put QC into a different “waiting input“ mode, where the next input will be sent into that callback instead of the normal command processor. Theres some caveats to think about though and I don’t want to rush into a poor design for implementation. That API could then neatly be expanded in the future without breaking backwards compatibility with stuff like
void RequestInput(Action<string> onSubmit, string prefix, Flags flags)
Where flags would allow you to do things like no echo or password mask
-
This could be rolled in with issue #134 where a command like “say” could be set as the default. If QC was being used as a chat window as suggested there, then it would be a simple matter of switching between default actions like “say”, “whisper”, “party”, etc.
-
repo owner - changed status to resolved
This was resolved in V2.6.4 with the addition of ReadLine and the Response flow
- Log in to comment
read without echo would be useful for password input