diff options
-rw-r--r-- | Makefile.PL | 2 | ||||
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | ReadKey.pm | 2 | ||||
-rw-r--r-- | ReadKey.xs | 17 | ||||
-rw-r--r-- | test.pl | 6 |
5 files changed, 18 insertions, 11 deletions
diff --git a/Makefile.PL b/Makefile.PL index eb1dd2a..966716f 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,4 +1,4 @@ -# Term::ReadKey Makefile.PL Version 2.11 +# Term::ReadKey Makefile.PL Version 2.12 use ExtUtils::MakeMaker; use Carp; @@ -1,4 +1,4 @@ - Term::ReadKey 2.11 - Change terminal modes, and perform non-blocking reads. + Term::ReadKey 2.12 - Change terminal modes, and perform non-blocking reads. Copyright (C) 1994-1997 Kenneth Albanowski. Unlimited distribution and/or modification is allowed as long as this copyright notice remains intact. @@ -204,7 +204,7 @@ Kenneth Albanowski <kjahds@kjahds.com> package Term::ReadKey; -$VERSION = "2.11"; +$VERSION = "2.12"; require Exporter; require AutoLoader; @@ -9,12 +9,15 @@ /******************************************************************* - Copyright (C) 1994,1995,1996, Kenneth Albanowski. Unlimited distribution - and/or modification is allowed as long as this copyright notice remains - intact. + Copyright (C) 1994,1995,1996,1997 Kenneth Albanowski. Unlimited + distribution and/or modification is allowed as long as this copyright + notice remains intact. Written by Kenneth Albanowski on Thu Oct 6 11:42:20 EDT 1994 Contact at kjahds@kjahds.com or CIS:70705,126 + + Version 2.12, Wed Jan 7 10:33:11 EST 1998 + Slightly modified test and error reporting for Win32. Version 2.11, Sun Dec 14 00:39:12 EST 1997 First attempt at Win32 support. @@ -744,7 +747,8 @@ int mode; # ifdef WIN32 - GetConsoleMode((HANDLE)_get_osfhandle(handle), &work.Mode); + if (!GetConsoleMode((HANDLE)_get_osfhandle(handle), &work.Mode)) + croak("GetConsoleMode failed, LastError=|%d|",GetLastError()); # endif /* WIN32 */ @@ -826,8 +830,9 @@ int mode; break; } - SetConsoleMode((HANDLE)_get_osfhandle(handle), work.Mode); - + if (!SetConsoleMode((HANDLE)_get_osfhandle(handle), work.Mode)) + croak("SetConsoleMode failed, LastError=|%d|",GetLastError()); + #endif /* WIN32 */ @@ -15,9 +15,11 @@ #BEGIN {@INC = ("/home/kjahds/perl5/perl5.000/lib/auto","/home/kjahds/perl5/perl5.000/lib"); } use Term::ReadKey; +use Fcntl; + if ($^O =~ /Win32/i) { - open(IN,'<CONIN$') or die "Unable to open console input"; - open(OUT,'<CONOUT$') or die "Unable to open console output"; + sysopen(IN,'CONIN$',O_RDWR) or die "Unable to open console input:$!"; + sysopen(OUT,'CONOUT$',O_RDWR) or die "Unable to open console output:$!"; } else { open(IN,"</dev/tty"); *OUT = *IN; |