getch([y, x])
Read a key press and return it as an integer.
y
Y-coordinate.
x
X-coordinate.
Wait until a key is pressed, or return -1 if the read is
non-blocking or times out.
An ordinary key is returned as the code of a single byte of its
encoding in the current locale, so a character encoded with several
bytes takes several calls. Use get_wch() to read it as a single
character.
In keypad mode function keys and other special keys are returned as
one of the KEY_* constants, which cannot be mistaken for an ordinary
key. Otherwise their bytes are returned one at a time.