Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v1_9_3_392) is shown here.
getch()public
Read and returns a character from the window.
See Curses::Key to all the function KEY_* available
static VALUE
window_getch(VALUE obj)
{
struct windata *winp;
struct wgetch_arg arg;
int c;
GetWINDOW(obj, winp);
arg.win = winp->window;
rb_thread_blocking_region(wgetch_func, (void *)&arg, RUBY_UBF_IO, 0);
c = arg.c;
if (c == EOF) return Qnil;
if (rb_isprint(c)) {
char ch = (char)c;
return rb_locale_str_new(&ch, 1);
}
return UINT2NUM(c);
}