+ printf("\n} asctosc[] = {\n");
+ /* Build the ascii part of the table. */
+ for (Ph = Hits, scancode = 0; Ph <= Hits+highestof(Hits);
+ Ph++, scancode++) {
+ ph = &Ph->hits;
+ for (i = 0; i < 4; i++) {
+ if (ph->hit[i].type == character) {
+ c = Ph->name[i][0]; /* "name" of this one */
+ if (tbl[c].shift[0] == 0) {
+ tbl[c].shift = shiftof[i];
+ tbl[c].scancode = scancode;
+ }
+ }
+ }
+ }
+ /* Now, output the table */
+ for (Pt = tbl, asciicode = 0; Pt <= tbl+highestof(tbl); Pt++, asciicode++) {
+ if (Pt->shift[0] == 0) {
+ if (isprint(asciicode) && (asciicode != ' ')) {
+ fprintf(stderr, "Unable to produce scancode sequence for");
+ fprintf(stderr, " ASCII character [%c]!\n", asciicode);
+ }
+ printf("\t{ cantdo, 0 },\t");
+ } else {
+ printf("\t{ %s, 0x%x },", Pt->shift, Pt->scancode);
+ }
+ printf("\t/* 0x%x", asciicode);
+ if (isprint(asciicode)) {
+ printf(" [%c]", asciicode);
+ }
+ printf(" */\n");
+ }
+
+
+ for (TC = &TC_Ascii[TC_LOWEST-TC_LOWEST];
+ TC < &TC_Ascii[TC_LOWEST_USER-TC_LOWEST]; TC++, asciicode++) {
+ printf("\t{ cantdo, 0 },\t");
+ printf("\t/* 0x%x */\n", asciicode);
+ }