note 30771 added to ref.ncurses
| From: | Habib at rack1 dot php dot net | Date: | Fri, 28 Mar 2003 00:13:07 +0000 |
| Subject: | note 30771 added to ref.ncurses | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45934@lists.php.net to get a copy of this message | ||
For those of you who want to check if <ENTER> key is passed,
you have to check the key agains both NL and CR keys:
function get_str()
{
for ($str = "";;){
$key = ncurses_getch();
switch ($key){
case 10: // newline
case 13: // Carrige Return
return($str);
default:
$str .= chr($key);
ncurses_refresh();
} // switch
} // for
} // get_str()
Hope that would help.
--
http://www.php.net/manual/en/ref.ncurses.php
http://master.php.net/manage/user-notes.php?action=edit+30771
http://master.php.net/manage/user-notes.php?action=delete+30771
http://master.php.net/manage/user-notes.php?action=reject+30771