10 static uchar
*charcode
[4] = {
11 normalmap
, shiftmap
, ctlmap
, ctlmap
16 if((st
& KBS_DIB
) == 0)
23 } else if(data
& 0x80){
25 data
= (shift
& E0ESC
? data
: data
& 0x7F);
26 shift
&= ~(shiftcode
[data
] | E0ESC
);
28 } else if(shift
& E0ESC
){
29 // Last character was an E0 escape; or with 0x80
34 shift
|= shiftcode
[data
];
35 shift
^= togglecode
[data
];
36 c
= charcode
[shift
& (CTL
| SHIFT
)][data
];
38 if('a' <= c
&& c
<= 'z')
40 else if('A' <= c
&& c
<= 'Z')