Hello guys,
I'm writing a console application that will run mostly on Linux shell, I've already implemented a nice library to handle escape sequences for colored text, cursor movements, message boxes, menu, etc... that I will publish when it will be completed.
I'm having a hard time to find a way to wait for a single character without the need to hit the enter key, which is required by the DebugPrompt()/ConsolePrompt() commands.
I've implemented a GridView and hitting enter after every command is very annoying (for example to scroll down the list line by line).
InKeyStr() can't ne used because Hollywood display is closed, this is a console app
Any tips? I'm missing something?
I've thought about opening for input the stdin, but I'm quiet a Linux newby so every hint in that direction is really appreciated
Console Application Input, hints needed :)
Console Application Input, hints needed :)
----------------------------
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Console Application Input, hints needed :)
That's probably not possible at the moment but could be added quite easily if you need it. Manually opening stdin won't work because OpenFile() doesn't support that... the only trick I can think of is starting a shell script which does it and then passes the result back to Hollywood via a temporary file but that's really awkward.
Re: Console Application Input, hints needed :)
Thank you Andreas for the answer,
well, I'll live with it for now, using a temporary file with another shell doesn't seem a solid way to achieve it.
If you are going to implement this function it could be handy for other people too who want to develop console applications
If it's possible an idea could be to add optional parameters to the ConsoleInput/DebugInput like InKeyStr, with type, maxlen and password arguments.
well, I'll live with it for now, using a temporary file with another shell doesn't seem a solid way to achieve it.
If you are going to implement this function it could be handy for other people too who want to develop console applications
If it's possible an idea could be to add optional parameters to the ConsoleInput/DebugInput like InKeyStr, with type, maxlen and password arguments.
----------------------------
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Console Application Input, hints needed :)
Yes, but I think I'll also add some special constants for OpenFile() that allow you to directly open stdin, stdout and stderr. Could be quite useful for several purposes...Allanon wrote: ↑Wed Jan 22, 2020 8:49 am If you are going to implement this function it could be handy for other people too who want to develop console applications
If it's possible an idea could be to add optional parameters to the ConsoleInput/DebugInput like InKeyStr, with type, maxlen and password arguments.
Re: Console Application Input, hints needed :)
Great!
Thank you for the efforts!
Thank you for the efforts!
----------------------------
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Console Application Input, hints needed :)
Code: Select all
- New: OpenFile() also accepts the special constants #STDIN, #STDOUT, and #STDERR now to open a program's
standard input/output/error streams; this can be useful for advanced users