CHAPTER 3
function with which you may alter the console keyboard taî™…
bles is called Keytbl(), and takes the following format:
char unshift[128], shift[128], capslock[128];
long vectable;
vectable = KeytbHunshift, shift, capslock);
where unshift, shift, and capslock are pointers to your own
128-byte tables. A value of -1 ($FFFFFFFF) in any of these
pointers will signal the function that you wish to leave that
table as it is. This function returns the pointer vectable, which
contains the address of a vector table. This vector table conî™…
tains pointers to each of the three keyboard tables. Its format
is
Byte
Number Contents
0-3 Address of the unshifted table
4-7 Address of shifted table
8-11 Address of CapsLock table
The brief sample program XKEYTBL.C (Program 3-2),
written in C, shows how to use the shift table for CapsLock
as well. This causes the punctuation marks located on the
number keys on top of the keyboard to be printed when
CapsLock is set, but still allows you to print numbers with
the numeric keypad.
Program 3-2. XKEYTBL.C
/**********************************************/
/* */
/* XKEYTBL.C — demonstrates use of the */
/* XBIOS routine to change the keyboard */
/* mapping tables, so that CapsLock */
/* keys have their Shifted value. */
/* V
/**********************************************/
if include <osbind.h> /* For XBIOS macro definitions */
main()
{
struct keytab /* Keytbl() returns a pointer */
{ /* to this kind of structure */
char *unshift;
char *shift?
char *capslock;
);
struct keytab *vt; /* Pointer to the vector table returned */
vt = (struct keytab *)Keytbl(-lL,-lL,-lL); /* get vector table */
Keytbl(-lL,-lL,vt->shift); /* put value of shift in CapsLock */
)
/******** end of XKEYTBL.C *****/
44