#21068 [Bgs]: ncurses_getch and ncurses_wgetch diff

From: Date: Wed, 18 Dec 2002 10:59:44 +0000
Subject: #21068 [Bgs]: ncurses_getch and ncurses_wgetch diff
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-27959@lists.php.net to get a copy of this message
 ID:               21068
 Updated by:       georg@php.net
 Reported By:      maillist@pnpitalia.it
 Status:           Bogus
 Bug Type:         Unknown/Other Function
 Operating System: SuSE 8.0
 PHP Version:      4.3.0RC3
 New Comment:

Forgot to say that you have to enable keypad for wgetch via
ncurses_keypad($win, TRUE);

Georg


Previous Comments:
------------------------------------------------------------------------

[2002-12-18 04:54:39] georg@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php

Note that not all function keys are supported on any particular
terminal. If you need F-Keys remove your putenv(...)


------------------------------------------------------------------------

[2002-12-17 11:40:39] maillist@pnpitalia.it

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)

------------------------------------------------------------------------

[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



Thread (4 messages)

« previous php.bugs (#27959) next »