bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getch() in nodelay mode returns KEY_RESIZE too late


From: Thomas Dickey
Subject: Re: getch() in nodelay mode returns KEY_RESIZE too late
Date: Sat, 13 Jun 2009 17:38:34 -0400
User-agent: Mutt/1.5.18 (2008-05-17)

On Mon, Jun 08, 2009 at 02:39:00PM +0200, Clemens Ladisch wrote:
> When the following program is run and its console window is resized, the
> first following getch() call returns ERR instead of KEY_RESIZE.  That
> KEY_RESIZE is returned only after the refresh() call, i.e., when a key
> is pressed or when the window is resized a second time.

I don't see that error (looking at a debug-trace, attached).
 
> #include <stdio.h>
> #include <poll.h>
> #include <errno.h>
> #include <ncurses.h>
> 
> int main()
> {
>         struct pollfd pfd;
>         int c;
> 
>         initscr();
>         cbreak();
>         noecho();
>         keypad(stdscr, TRUE);
>         nodelay(stdscr, TRUE);
>         pfd.fd = fileno(stdin);
>         pfd.events = POLLIN;
>         for (;;) {
>                 if (poll(&pfd, 1, -1) < 0) {
>                         if (errno != EINTR)
>                                 break;
>                 }
>                 while ((c = getch()) != ERR) {
>                         printw("key: %s\n", keyname(c));
>                 }
>                 refresh();
>         }
>         return 0;
> }
> 
> 
> _______________________________________________
> Bug-ncurses mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-ncurses


-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net

Attachment: trace.gz
Description: Binary data

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]