NotaBene Mailing List 2002

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: key scan codes



There are actually two related functions for key/scan codes in NBWin,
and, respectively, two related programs in XYWWWEB.U2. The one posted on
the list, XYWWWEB's "scan*" or "scancode", uses the NB function <<VA$SC>>
and reports a distinct code for every shift state of a key. The other is
called "keycode", is based on <<VN$KC>>, and reports the same code for
the key irrespective of the state of the shift keys--and this is the
same number as scancode's unshifted code.

You can play with these by inserting the "deltas" <<VA$SC>> and <<VN$KC>>
in a file and looking (in a view other than show codes) what happens when
you press different key combinations. 

Apart from the two programs showing scan/key codes, these functions are
used in several other XYWWWEB programs to determine what key the user
has pressed. It is very handy in detecting such keys as <ESC> and
<ENTER>, which were somewhat tricky in NB4's xpl dialect.

j-p takala



Main Index | Thread Index