Pushes a character onto the input queue.
Curses Library (libcurses.a)
#include <curses.h>
int ungetch
(int ch);
int unget_wch
(const wchar_t wch);
The ungetch subroutine pushes the single-byte character ch onto the head of the input queue.
The unget_wch subroutine pushes the wide character wch onto the head of the input queue.
One character of push-back is guaranteed. The result of successive calls without an intervening call to the getch or get_wch subroutine are unspecified.
Item | Description |
---|---|
ch | |
wch |
To force the key KEY_ENTER back into the queue, use:
ungetch(KEY_ENTER);