- for (i = 0; i < 4; i++) {
- if ((Ph->name[i][4] == TC->tc_name[0])
- && (strcmp(Ph->name[i]+4, TC->tc_name) == 0)) {
- /* This is THE hit! */
- found = 1;
- printf("\t{ ");
- switch (i) {
- case 0:
- printf("normal, ");
- break;
- case 1:
- printf("shifted, ");
- break;
- case 2:
- printf("alted, ");
- break;
- case 3:
- printf("shitfalted, ");
- break;
- }
- printf("0x%x },\n", Ph-Hits);
+ }
+ }
+ }
+ /* Now, output the table */
+ for (Pt = tbl, asciicode = 0; Pt <= tbl+highestof(tbl); Pt++, asciicode++) {
+ if (Pt->used == 0) {
+ if (isprint(asciicode) && (asciicode != ' ')) {
+ fprintf(stderr, "Unable to produce scancode sequence for");
+ fprintf(stderr, " ASCII character [%c]!\n", asciicode);
+ }
+ printf("\t{ 0, 0, undefined, 0 },\t");
+ } else {
+ printf("\t{ 0x%02x, %s, FCN_CHARACTER, 0 },",
+ Pt->scancode, Pt->shiftstate);
+ }
+ printf("\t/* 0x%x", asciicode);
+ if (isprint(asciicode)) {
+ printf(" [%c]", asciicode);
+ }
+ printf(" */\n");
+ }
+
+
+ for (attable = &table[0]; attable <= &table[highestof(table)]; attable++) {
+ for (this = *attable; this; this = this->next) {
+ Ph = this->hits;
+ if (Ph == 0) {
+ continue;
+ }
+ for (i = 0; i < 4; i++) {
+ if ((Ph->name[i] != 0) &&
+ (Ph->name[i][0] == this->name[0]) &&
+ (strcmp(Ph->name[i], this->name) == 0)) {
+ printf("\t{ 0x%02x, %s, ",
+ Ph-Hits, shiftof[i]);
+ if (memcmp("AID_", this->name, 4) == 0) { /* AID key */
+ printf("FCN_AID, ");
+ } else {
+ printf("%s, ", Ph->name[i]);
+ }
+ if (memcmp("PF", this->name+4, 2) == 0) {
+ printf("\"PFK%s\" },\n", Ph->name[i]+4+2);
+ } else {
+ printf("\"%s\" },\n", Ph->name[i]+4);