getch(3NCURSES) getch(3NCURSES)
NAME
getch, wgetch, mvgetch, mvwgetch, ungetch, has_key - get (or push back) characters from curses terminal keyboard
SYNOPSIS
#include <curses.h>
int getch(void);
int wgetch(WINDOW *win);
int mvgetch(int y, int x);
int mvwgetch(WINDOW *win, int y, int x);
int ungetch(int ch);
int has_key(int ch);
DESCRIPTION
The getch, wgetch, mvgetch and mvwgetch, routines read a character from the window.
In no-delay mode, if no input is waiting, the value ERR is re‐
turned. In delay mode, the program waits until the system passes text through to the program. Depending on the setting of cbreak, this is after one
character (cbreak mode), or after the first newline (nocbreak mode). In half-delay mode, the program waits until a character is typed or the speci‐
fied timeout has been reached.