#21068 [Opn]: ncurses_getch and ncurses_wgetch diff

From: Date: Tue, 17 Dec 2002 17:40:40 +0000
Subject: #21068 [Opn]: ncurses_getch and ncurses_wgetch diff
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-27937@lists.php.net to get a copy of this message
ID: 21068 User updated by: maillist@pnpitalia.it Reported By: maillist@pnpitalia.it Status: Open Bug Type: Unknown/Other Function Operating System: SuSE 8.0 PHP Version: 4.3.0RC3 New Comment: maybe this is not a bug, maybe if it is it's not related to php but to ncurses 5.3 which I use, in this case anyone know a workaround (not to rewrite a php getch which can handle different key sequences). Now the result is correct if I don't use window ($ch=265), wgetch return the sequence $ch=(27, 91, 91, 65) Previous Comments: ------------------------------------------------------------------------ [2002-12-17 11:33:01] maillist@pnpitalia.it <?php // francesco riosa, ncurses test, 20021217 // telnet client = putty // use "e" = exit ; "w" window // see the difference of the function keys inside and outside the window putenv("TERM=linux"); ncurses_init(); $i=0; ncurses_move($i++, 1); ncurses_addstr("NCURSES_KEY_F1=" . NCURSES_KEY_F1 ); while ($ch <> ord('e')) { $ch = ncurses_getch(); ncurses_move($i++, 1); ncurses_addstr("key --$ch--"); if ($ch == ord('w')) { $winhandle = ncurses_newwin( 20, 40, $i++, 4); $j=1; ncurses_wborder($winhandle,0,0,0,0,0,0,0,0); while ($ch <> ord('e')) { $ch = ncurses_wgetch($winhandle); ncurses_wmove($winhandle, $j++, 1); ncurses_waddstr($winhandle, "key --$ch--"); } } } ncurses_end(); ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21068&edit=1

« previous php.bugs (#27937) next »