Allasso has asked for the wisdom of the Perl Monks concerning the following question:
The capturing is to deal with such things as arrow keys so the user (me) can navigate and more easily edit text before submitting. I am wondering if there is a way, AFTER the user has done their editing, and submits, can the text that is displayed in the terminal be read in its updated form from the terminal? This would save me having to track every input event to construct the final string. Thanks!use IO::Handle; my $stdin = new IO::Handle; $stdin->fdopen( fileno( STDIN ), "r" ) || die "Cannot open STDIN"; while ( my $char = $stdin->getc() ) { # ... etc etc
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Capture user input AND read after it has been modified
by LanX (Saint) on Apr 29, 2019 at 01:17 UTC | |
by Allasso (Monk) on Apr 29, 2019 at 01:25 UTC | |
by hdb (Monsignor) on Apr 29, 2019 at 07:51 UTC | |
by Allasso (Monk) on Apr 29, 2019 at 11:43 UTC |