perlophone has asked for the wisdom of the Perl Monks concerning the following question:
(Updated) Thanks all for your help. For those that are curious, the following ReadKey-based snippet works:#! perl -w use strict; use Win32::Console; my ($Console); $Console = new Win32::Console(STD_INPUT_HANDLE); $Console->Alloc(); $Console->Display(); $Console->Mode(0); $| = 1; print "Hit any character to stop program>"; $Console->Input(); print "\nStopped program\n"; $Console->Flush(); exit(0);
#! perl -w use Term::ReadKey; use strict; my ($Key); $| = 1; print "Hit any character to stop program>"; ReadMode 3; for(;;) { $Key = ReadKey 0.1; if(defined($Key)) { last; } } ReadMode 0; print "Stopped program\n"; exit(0);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Double clicking a raw mode Win32::Console app
by BrowserUk (Patriarch) on Sep 26, 2008 at 01:01 UTC | |
|
Re: Double clicking a raw mode Win32::Console app
by ikegami (Patriarch) on Sep 26, 2008 at 00:47 UTC | |
|
Re: Double clicking a raw mode Win32::Console app
by gok8000 (Scribe) on Sep 26, 2008 at 19:15 UTC | |
by MidLifeXis (Monsignor) on Sep 27, 2008 at 02:29 UTC |