On Sat, 20 Nov 2004, Lars Ivar Igesund wrote:
I'm trying to write a curses-like library for D (it started out as a port of
PDCurses, but I wanted to use the OO-features of D, so it turned out to be a
rewrite), and I'm using PDCurses as a help to understand what's needed,
especially at the OS-level.
In the function getInterestingEvent in win32/pdckbd.c, several decimal values
are compared with the virtual key code of the event. The result is then used
as a throw away criteria, etc. What I have difficulties grokking is the
meaning of these values (20, 144, 145, 16, 17, 18). It is presumably control
characters of some sort, but I don't really know.
Sorry for late reply... You have probably already figured this out?
I haven't read the source code of pdcurses, but I think these values
might be the PC codes for function keys, arrow keys and similar
non-ASCII keys. IIRC, when such a key is typed, BIOS will provide a
two-byte escape sequence representing the key, consisting of 0 (zero)
and the key value (20, 144 etc.). This convention is probably still
followed for programs run inside a console in Windows.