bug-ncurses
[Top][All Lists]
Advanced

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

getch() doesn't return ERR when in nocbreak and nodelay mode.


From: Nils Christopher Brause
Subject: getch() doesn't return ERR when in nocbreak and nodelay mode.
Date: Sun, 10 Feb 2013 19:19:25 +0100

Hi!

When ncurses is in nocbreak and nodelay mode, according to the man pages, getch() should return ERR when no key has been pressed. But instead it returns '\n' every time it is called.

Consider this very simple program:

#include <stdio.h>
#include <ncurses.h>
int main()
{
  FILE *log;
  log = fopen("log", "w");
  initscr();
  noecho();
  nocbreak();
  nodelay(stdscr, TRUE);
  int c;
  while((c = getch()) != ERR) fprintf(log, "%d,", c);
  endwin();
  fclose(log);
  return 0;
}

PDCurses doesn't do this. I'm using ncurses 5.9. Is this a bug in ncurses?

Greetings,
Yukicanis


reply via email to

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