Syntax-K

Know-How für Ihr Projekt

Perl Documentation

NAME

Term::ReadKey - A perl module for simple terminal control

SYNOPSIS

use Term::ReadKey;
ReadMode 4; # Turn off controls keys
while (not defined ($key = ReadKey(-1))) {
    # No key yet
}
print "Get key $key\n";
ReadMode 0; # Reset tty mode before exiting

DESCRIPTION

Term::ReadKey is a compiled perl module dedicated to providing simple control over terminal driver modes (cbreak, raw, cooked, etc.,) support for non-blocking reads, if the architecture allows, and some generalized handy functions for working with terminals. One of the main goals is to have the functions as portable as possible, so you can just plug in "use Term::ReadKey" on any architecture and have a good likelihood of it working.

Version 2.30.01: Added handling of arrows, page up/down, home/end, insert/delete keys under Win32. These keys emit xterm-compatible sequences. Works with Term::ReadLine::Perl.

AUTHOR

Kenneth Albanowski <kjahds@kjahds.com>

Currently maintained by Jonathan Stowe <jns@gellyfish.co.uk>

SUPPORT

The code is maintained at

https://github.com/jonathanstowe/TermReadKey

Please feel free to fork and suggest patches.

LICENSE

Prior to the 2.31 release the license statement was:

Copyright (C) 1994-1999 Kenneth Albanowski.
              2001-2005 Jonathan Stowe and others
Unlimited distribution and/or modification is allowed as long as this
copyright notice remains intact.

And was only stated in the README file.

Because I believe the original author's intent was to be more open than the other commonly used licenses I would like to leave that in place. However if you or your lawyers require something with some more words you can optionally choose to license this under the standard Perl license:

This module is free software; you can redistribute it and/or modify it
under the terms of the Artistic License. For details, see the full
text of the license in the file "Artistic" that should have been provided
with the version of perl you are using.
This program is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.