php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #64706 add wrapper of ncurses_wtimeout
Submitted: 2013-04-24 19:00 UTC Modified: 2017-10-20 22:31 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:1 (33.3%)
From: mfm at rhsonline dot net Assigned:
Status: Suspended Package: ncurses (PECL)
PHP Version: Irrelevant OS: debian
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mfm at rhsonline dot net
New email:
PHP Version: OS:

 

 [2013-04-24 19:00 UTC] mfm at rhsonline dot net
Description:
------------
I needed to change timeout of getch() on a particular window, not just the 
standard window.  So I created the included patch to add this support. This was 
accomplished by wrapping around ncurses_wtimeout.


Test script:
---------------
<?php
ncurses_init();
ncurses_cbreak();
ncurses_noecho();
$window = ncurses_newwin(10,10,0,0);
ncurses_timeout(1000);
ncurses_wgetch($window); // will wait here until button pressed.
echo "not reached until after character";
ncurses_delwin();
ncurses_clear();
ncurses_refresh();
ncurses_end();
?>

Expected result:
----------------
on the ncurses_wgetch($window) line, it will wait and not honor the timeout.
However, with the patch and replacing:
ncurses_timeout(1000);
with:
ncurses_wtimeout(1000);

It will stop looking for input after a second, which is the desired effect.


Patches

add-ncurses_wtimeout (last revision 2013-04-24 19:01 UTC by mfm at rhsonline dot net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-20 22:31 UTC] kalle@php.net
-Status: Open +Status: Suspended
 [2017-10-20 22:31 UTC] kalle@php.net
I'm gonna suspend this report as the ncurses extension seems to no longer be actively maintained, any future maintainer should re-open this report
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 02:01:28 2024 UTC