[Tux4kids-tuxtype-dev] Key mapping bug
Matthew Trey
tux4kids at treyhome.com
Wed Aug 26 19:32:57 UTC 2009
When in any practice mode (lesson or phrase typing) the bottom row of keys
is always 1 off when flashing the hint. This is due them being 1 off in
alphabet.c D01 is actually the extra key from the international keyboard,
and Z should be D02. Patch is below.
What is the plan for handling other (international) key mappings? I noticed
a comment in the source about finding a better way to load in the keyboard.
Perhaps in the themes/*/keyboard.lst a third field containing the key
location is a good solution at least for the short term?
------ Patch begins here -----
--- alphabet.c.orig 2009-08-26 14:53:18.000000000 -0400
+++ alphabet.c 2009-08-26 14:26:30.000000000 -0400
@@ -1077,83 +1077,83 @@
keyboard_entry->shift=1;
keyboard_entry->finger=9;
break;
- case 'z':strcpy(keyboard_entry->keyname,"D01");
+ case 'z':strcpy(keyboard_entry->keyname,"D02");
keyboard_entry->shift=0;
keyboard_entry->finger=0;
break;
- case 'Z':strcpy(keyboard_entry->keyname,"D01");
+ case 'Z':strcpy(keyboard_entry->keyname,"D02");
keyboard_entry->shift=2;
keyboard_entry->finger=0;
break;
- case 'x':strcpy(keyboard_entry->keyname,"D02");
+ case 'x':strcpy(keyboard_entry->keyname,"D03");
keyboard_entry->shift=0;
keyboard_entry->finger=1;
break;
- case 'X':strcpy(keyboard_entry->keyname,"D02");
+ case 'X':strcpy(keyboard_entry->keyname,"D03");
keyboard_entry->shift=2;
keyboard_entry->finger=1;
break;
- case 'c':strcpy(keyboard_entry->keyname,"D03");
+ case 'c':strcpy(keyboard_entry->keyname,"D04");
keyboard_entry->shift=0;
keyboard_entry->finger=2;
break;
- case 'C':strcpy(keyboard_entry->keyname,"D03");
+ case 'C':strcpy(keyboard_entry->keyname,"D04");
keyboard_entry->shift=2;
keyboard_entry->finger=2;
break;
- case 'v':strcpy(keyboard_entry->keyname,"D04");
+ case 'v':strcpy(keyboard_entry->keyname,"D05");
keyboard_entry->shift=0;
keyboard_entry->finger=3;
break;
- case 'V':strcpy(keyboard_entry->keyname,"D04");
+ case 'V':strcpy(keyboard_entry->keyname,"D05");
keyboard_entry->shift=2;
keyboard_entry->finger=3;
break;
- case 'b':strcpy(keyboard_entry->keyname,"D05");
+ case 'b':strcpy(keyboard_entry->keyname,"D06");
keyboard_entry->shift=0;
keyboard_entry->finger=3;
break;
- case 'B':strcpy(keyboard_entry->keyname,"D05");
+ case 'B':strcpy(keyboard_entry->keyname,"D06");
keyboard_entry->shift=2;
keyboard_entry->finger=3;
break;
- case 'n':strcpy(keyboard_entry->keyname,"D06");
+ case 'n':strcpy(keyboard_entry->keyname,"D07");
keyboard_entry->shift=0;
keyboard_entry->finger=6;
break;
- case 'N':strcpy(keyboard_entry->keyname,"D06");
+ case 'N':strcpy(keyboard_entry->keyname,"D07");
keyboard_entry->shift=1;
keyboard_entry->finger=6;
break;
- case 'm':strcpy(keyboard_entry->keyname,"D07");
+ case 'm':strcpy(keyboard_entry->keyname,"D08");
keyboard_entry->shift=0;
keyboard_entry->finger=6;
break;
- case 'M':strcpy(keyboard_entry->keyname,"D07");
+ case 'M':strcpy(keyboard_entry->keyname,"D08");
keyboard_entry->shift=1;
keyboard_entry->finger=6;
break;
- case ',':strcpy(keyboard_entry->keyname,"D08");
+ case ',':strcpy(keyboard_entry->keyname,"D09");
keyboard_entry->shift=0;
keyboard_entry->finger=7;
break;
- case '<':strcpy(keyboard_entry->keyname,"D08");
+ case '<':strcpy(keyboard_entry->keyname,"D09");
keyboard_entry->shift=1;
keyboard_entry->finger=7;
break;
- case '.':strcpy(keyboard_entry->keyname,"D09");
+ case '.':strcpy(keyboard_entry->keyname,"D10");
keyboard_entry->shift=0;
keyboard_entry->finger=8;
break;
- case '>':strcpy(keyboard_entry->keyname,"D09");
+ case '>':strcpy(keyboard_entry->keyname,"D10");
keyboard_entry->shift=1;
keyboard_entry->finger=8;
break;
- case '/':strcpy(keyboard_entry->keyname,"D10");
+ case '/':strcpy(keyboard_entry->keyname,"D11");
keyboard_entry->shift=0;
keyboard_entry->finger=9;
break;
- case '?':strcpy(keyboard_entry->keyname,"D10");
+ case '?':strcpy(keyboard_entry->keyname,"D11");
keyboard_entry->shift=1;
keyboard_entry->finger=9;
break;
@@ -1219,8 +1219,8 @@
case 'A': new.y += 6; new.x += 12; break;
case 'B': new.y += 39; new.x += 23; break;
case 'C': new.y += 69; new.x += 33; break;
-// case 'D': new.y += 96; new.x += 23; break;
- case 'D': new.y += 99; new.x += 54; break;
+ case 'D': new.y += 96; new.x += 23; break;
+// case 'D': new.y += 99; new.x += 54; break;
case 'E': new.y += 129; break;
default: render = 0; break;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/tux4kids-tuxtype-dev/attachments/20090826/74b28d9b/attachment-0001.htm>
More information about the Tux4kids-tuxtype-dev
mailing list