note 58491 added to function.ncurses-cbreak
| From: | satoru at osu1 dot php dot net | Date: | Sun, 06 Nov 2005 07:14:52 +0000 |
| Subject: | note 58491 added to function.ncurses-cbreak | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-98142@lists.php.net to get a copy of this message | ||
<?php
/**************************************
[WARNING!]
Your terminal may be uncontrollable.
[HOW TO EXIT]
Push space key to terminate raw mode.
[TESTING]
Tested with FreeBSD5.3R + PHP5.0.5-CLI.
The option '--with-ncurses' required.
**************************************/
$tty = system("tty");
$handle = fopen($tty, "r");
if (!$handle)
exit("cannot open $tty.\\n");
print "Push space key to terminate.\\n";
ncurses_init();
ncurses_raw();
do {
$ch = fread($handle, 1);
printf('[%d] ', ord($ch));
} while ($ch != " " && ord($ch) != 3);
ncurses_noraw();
ncurses_end();
print "\\n";
fclose($handle);
?>
----
Manual Page -- http://www.php.net/manual/en/function.ncurses-cbreak.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+58491
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58491&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58491&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58491&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58491&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58491&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58491&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58491&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+58491&report=yes
Search -- http://master.php.net/manage/user-notes.php