buffer[0] = code;
actual = MapANSI(buffer, 1, rBuffer, STIMSIZE, 0);
r = rBuffer;
event.ie_Prev2DownCode = 0;
event.ie_Prev2DownQual = 0;
event.ie_Prev1DownCode = 0;
event.ie_Prev1DownQual = 0;
switch (actual) {
case -2:
printf("MapANSI internal error");
goto reportChar;
case -1:
printf("MapANSI overflow error");
goto reportChar;
case 0:
printf("MapANSI ungeneratable code");
goto reportChar;
case 3:
event.ie_Prev2DownCode = *r++;
event.ie_Prev2DownQual = *r++;
case 2:
event.ie_Prev1DownCode = *r++;
event.ie_Prev1DownQual = *r++;
case 1:
event.ie_Code = *r++;
event.ie_Qualifier = *r;
actual =
MapRawKey(&event, buffer, BUFFERLEN, 0);
if ((actual != 1) || (buffer[0] != code)) {
printf("MapANSI not reversible");
for (i = 0; i < actual; i++)
printf(" from");