After banging my head over this for awhile, I discovered, you must use ncurses_keypad($window, true); to enable the arrow keys and f keys to work correctly.
ncurses_getch
説明
int ncurses_getch ( void )| 警告 |
この関数は、 実験的 なものです。この関数の動作・ 名前・その他ドキュメントに書かれている事項は、予告なく、将来的な PHP のリリースにおいて変更される可能性があります。 この関数は自己責任で使用してください。 |
| 警告 |
この関数は、 現在のところ詳細な情報はありません。引数のリストのみが 記述されています。 |
ncurses_getch
php at kormoc dot com
23-Nov-2005 08:45
23-Nov-2005 08:45
joeldegan AT yahoo.com
17-Dec-2002 05:29
17-Dec-2002 05:29
When using getch to capture KEY_* events remember that the keypad is arranged like this:
+-----+------+-------+
| A1 | up | A3 |
+-----+------+-------+
|left | B2 | right |
+-----+------+-------+
| C1 | down | C3 |
+-----+------+-------+
You use has_key to capture these and act upon them.
man curs_getch for more info.
pablorNOSPAM at nkstudios dot net
14-Sep-2002 05:40
14-Sep-2002 05:40
A custom php ncurses_getstr function..
<?php
function ncurses_getstr($strlen){
for ($x=0;$x<$strlen;$x++){
$string .= chr(ncurses_getch());
}
return $string;
}
ncurses_init();
ncurses_addstr(ncurses_getstr(6));
ncurses_refresh();
ncurses_getch();
ncurses_end();
?>