summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.PL2
-rw-r--r--README2
-rw-r--r--ReadKey.pm2
-rw-r--r--ReadKey.xs17
-rw-r--r--test.pl6
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;
diff --git a/README b/README
index 21b3c66..22f8c89 100644
--- a/README
+++ b/README
@@ -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.
diff --git a/ReadKey.pm b/ReadKey.pm
index ebb5d00..c36b157 100644
--- a/ReadKey.pm
+++ b/ReadKey.pm
@@ -204,7 +204,7 @@ Kenneth Albanowski <kjahds@kjahds.com>
package Term::ReadKey;
-$VERSION = "2.11";
+$VERSION = "2.12";
require Exporter;
require AutoLoader;
diff --git a/ReadKey.xs b/ReadKey.xs
index 97f6f2d..023a1e2 100644
--- a/ReadKey.xs
+++ b/ReadKey.xs
@@ -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 */
diff --git a/test.pl b/test.pl
index 0a44f53..b593115 100644
--- a/test.pl
+++ b/test.pl
@@ -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;