Index: aktousb/circuit/ps2toserial.pro
===================================================================
--- aktousb/circuit/ps2toserial.pro	(revision 49fd394986aa947808c9037bb0ef5135663b4329)
+++ aktousb/circuit/ps2toserial.pro	(revision ff4dbfdb21acb1d89de7181dfb2953800c7b066e)
@@ -1,5 +1,5 @@
 version=1
-last_client=kicad
-update=02/08/2010 09:46:23
+last_client=pcbnew
+update=14/08/2010 15:48:31
 [cvpcb]
 version=1
@@ -73,4 +73,6 @@
 LibName29=contrib
 LibName30=valves
+[general]
+version=1
 [pcbnew]
 version=1
@@ -105,4 +107,2 @@
 LibName11=r_mini_din
 LibName12=ENSSAT_robotique
-[general]
-version=1
Index: aktousb/code/keyboard.hex
===================================================================
--- aktousb/code/keyboard.hex	(revision 49fd394986aa947808c9037bb0ef5135663b4329)
+++ aktousb/code/keyboard.hex	(revision ff4dbfdb21acb1d89de7181dfb2953800c7b066e)
@@ -1,3 +1,3 @@
-:10000000A7C076C2CAC0BFC0BEC0BDC0BCC0BBC056
+:10000000A7C0ACC2CAC0BFC0BEC0BDC0BCC0BBC020
 :10001000BAC0B9C0B8C0B7C0B6C0B5C0B4C0B3C02C
 :10002000B2C0B1C0B0C0351E1F2021222324252616
@@ -21,7 +21,7 @@
 :100140002101010001223F000705810308000A0088
 :1001500011241FBECFE5D4E0DEBFCDBF10E0A0E686
-:10016000B0E0E6EEF9E002C005900D92A436B107CA
+:10016000B0E0E2E5FAE002C005900D92A436B107D6
 :10017000D9F710E0A4E6B0E001C01D92AC3AB10797
-:10018000E1F716D12EC43CCF8C9A949884E591E087
+:10018000E1F728D164C43CCF8C9A949884E591E03F
 :100190000197F1F7949A8C9808951F920F920FB6D9
 :1001A0000F9211242F933F938F939F9383992CC089
@@ -44,118 +44,125 @@
 :1002B00068000895282F30E0F901EA5DFF4F44916E
 :1002C0008056883010F030E004C02A5C3F4FF901BE
-:1002D00034914423E9F02091610092E015C0E92FA8
-:1002E000F0E0E859FF4F8081841769F407C0E92FD7
-:1002F000F0E0E859FF4F818180839F5F9730B8F32A
-:1003000010926F0021509F5F921748F32093610075
-:100310003095809168003823309368000895FC017F
-:1003200088E690E0909391008093900080818076A1
-:10033000803271F58181813011F488E0089589302F
-:1003400049F486819781019719F581E080936400D3
-:100350008FEF0895823019F487E690E013C08A3059
-:1003600029F483818093670080E00895833031F41D
-:100370008381882369F41092600008958B3041F4E2
-:1003800080E690E0909391008093900081E0089542
-:1003900080E00895FC0180916400882329F0613099
-:1003A00019F48081809365001092640081E00895C3
-:1003B000DF92EF92FF920F931F932FE088E190E07E
-:1003C0000FB6F894A89581BD0FBE21BD85E083BF0F
-:1003D000A59AA49A88E0E8E6F0E0DF011D928A95EC
-:1003E000E9F7A7D12BDF789400E090E1D92E80E2E5
-:1003F000E82EFF24F39401C0012FA895A7D1809186
-:100400007500809175008823C1F007DF95B39D25A5
-:1004100095BB95B39E2595BB982F969580FD03C0FF
-:10042000892F20DF02C0892F45DF8091810084FF62
-:1004300004C088E690E068E0B1D208B600FEDDCFE7
-:10044000F8BE109167001123C1F2053018F0102F8B
-:100450001550D2CF80916600882321F082E62ADFF2
-:10046000109266008091810084FFC6CF88E690E0FC
-:1004700068E094D2C1CFDF93CF93CDB7DEB7289792
-:100480000FB6F894DEBF0FBECDBF982F80918100CC
-:1004900084FFFCCFFE01319688E0DF011D928A9532
-:1004A000E9F799836B83CF0168E078D228960FB67D
-:1004B000F894DEBF0FBECDBFCF91DF910895A82F76
-:1004C000B92F80E090E041E050EA609530E009C04B
-:1004D0002D9182279795879510F084279527305E78
-:1004E000C8F36F5FA8F30895EADF8D939D93089595
-:1004F000CF93CFB7CF93DF93C395859BE9F7859BC8
-:100500000BC0859B09C0859B07C0859B05C0859B4B
-:1005100003C0859B01C08BC06F93C0918F00DD2706
-:10052000CA56DF4F2F9365E5859B03C02F916F91CE
-:10053000E6CF0F931F934F9320E040E15F9300B30A
-:10054000047205FB27F93F9350E03BE039C0147279
-:1005500040642F77012F5F5F1EC0406810B3147294
-:100560002F7752501FC0406400B32F770472D1F12F
-:100570005F5F00C023C0406210B32F77147291F107
-:100580005F5F00C025C004721027515012F45D5FF8
-:100590000000115027952C3F10B3C8F614720127A4
-:1005A000015027952C3FC8F64227499300B30472A7
-:1005B00010274F73115027952C3FA8F64695469566
-:1005C00010B3147279F00127015027952C3F98F64B
-:1005D0006B5A60F3315000B3B0F600C010E41ABF9C
-:1005E000002719C03B503195C31BD04010E41ABFFF
-:1005F0000881033C09F10B34F9F020918D00198139
-:10060000110F1213EDCF4A81441F093651F10D32FB
-:1006100011F0013E29F7009394003F915F914F91B3
-:100620001F910F912F916F91CAB7C6FD65CFDF91D2
-:10063000CF91CFBFCF91189520919400222369F3D9
-:1006400010919200112391F5343092F13093920081
-:1006500020938E0010918F003BE0311B30938F0070
-:1006600027C00091920001300CF50AE54F7049F463
-:100670003091620034FD1DC000936200C6E7D0E0F7
-:100680001CC03091810034FD14C000938100C2E889
-:10069000D0E013C0052710E000C0000002BB1AC064
-:1006A000052710E0221F1DC010E021C04AE502C04E
-:1006B00032ED432FC4E1D0E032E011B31462959AD9
-:1006C00002B311BB54E220E865E320FF052702BB1B
-:1006D000279517951C3FF0F66695B8F7B1F720FF00
-:1006E000052702BB279517951C3FD0F62795179530
-:1006F00017FF052700001C3F02BBB0F629913A9571
-:1007000019F70B7D10919300110FC651D04002BB19
-:1007100011F010938D0010E41ABF006211B31B7D1D
-:10072000402F4B7D54E05A95F1F702BB11BB42BB01
-:1007300074CF85B7836085BF8BB780648BBF8BE434
-:10074000809382008AE58093810008951F93CF9360
-:10075000DF9360919200635067FDC4C080918F0069
-:10076000CCE0D0E0C81BD109CA56DF4F80918E0083
-:100770008D3209F0A4C0683009F0B2C083EC8093D8
-:1007800076008AE5809362001092700088818076FE
-:1007900041F0CE010E948F01282F8F3F09F47EC0C7
-:1007A00084C09A8110927F008981882321F410925D
-:1007B000800022E06CC0853019F49093930066C0ED
-:1007C000863009F04FC08B81813041F48BE191E09C
-:1007D000909391008093900022E140C0823041F4D8
-:1007E0008DE291E0909391008093900022E236C0D8
-:1007F0008330F9F48A81882341F48DED90E0909361
-:1008000091008093900024E029C0813041F481EE72
-:1008100090E0909391008093900024E21FC082307A
-:10082000E1F485E091E0909391008093900026E1BF
-:1008300015C0813241F48FE391E090939100809351
-:10084000900029E00BC0823241F48EE990E0909351
-:100850009100809390002FE301C020E080E480931A
-:10086000700023C0883021F421E085E990E011C0B8
-:10087000893019F49093950009C08A3011F421E071
-:1008800006C08B3019F48BE48093820020E08FE760
-:1008900090E0909391008093900007C0888187FD3D
-:1008A0002E8180E88093700006C08F81882319F420
-:1008B0008E81821708F0822F8093630011C080918F
-:1008C000700087FF0DC0CE010E94CA018F3F21F446
-:1008D0008EE18093620004C0882311F010926300BF
-:1008E000109292008091620084FF4AC08091630060
-:1008F0008F3F09F445C0182F893008F018E0811B9C
-:10090000809363008091760098E889278093760031
-:10091000112341F12091900030919100809170005D
-:1009200086FF0DC0A7E7B0E080E090E0F901E80F96
-:10093000F91FE491ED9301961817C1F708C0912FA4
-:10094000D901E7E7F0E08D9181939150E1F71150E3
-:10095000812F90E01F5F0196820F931F909391006B
-:100960008093900087E790E0612F0E947402612FCE
-:100970006C5F6C3019F08FEF8093630060936200BE
-:1009800094E180B3847231F49150D9F710929300BE
-:1009900010928D00DF91CF911F9108951F93DC017C
-:1009A000162F8091810084FF07C08091820098E813
-:1009B00089278093820003C08AE580938100912F6C
-:1009C000E3E8F0E08D91819391501916DCF383E810
-:1009D00090E0612F0E9474021C5F109381001F91B0
-:0609E0000895F894FFCF1A
-:0409E60001025AFFB1
+:1002D0003491493381F480916100883058F5E82FDA
+:1002E000F0E0E859FF4F40838F5F8093610081E029
+:1002F000809366001FC04423E9F02091610092E0E2
+:1003000015C0E92FF0E0E859FF4F8081841769F4A8
+:1003100007C0E92FF0E0E859FF4F818180839F5F9C
+:100320009730B8F310926F0021509F5F921748F3F7
+:1003300020936100309580916800382330936800E5
+:100340000895FC0188E690E09093910080939000DE
+:1003500080818076803271F58181813011F488E06E
+:100360000895893049F486819781019719F581E0D4
+:10037000809364008FEF0895823019F487E690E04F
+:1003800013C08A3029F483818093670080E0089548
+:10039000833031F48381882369F4109260000895DA
+:1003A0008B3041F480E690E0909391008093900030
+:1003B00081E0089580E00895FC0180916400882325
+:1003C00029F0613019F480818093650010926400F7
+:1003D00081E00895FF920F931F93CF93DF932FE057
+:1003E00088E190E00FB6F894A89581BD0FBE21BDBD
+:1003F00085E083BF8E9A88E0E8E6F0E0DF011D9299
+:100400008A95E9F7CCD11ADF789400E0C0E1D0E01A
+:10041000FF24F39401C0012FA895CED180917500DF
+:1004200080917500882391F0F8DE982F969580FDD5
+:1004300003C0892F17DF02C0892F3CDF8091810024
+:1004400084FF04C088E690E068E0DED208B600FED3
+:10045000E3CFF8BE80916600882321F0969A219719
+:1004600019F025C0969823C0109266004091610053
+:1004700022E030E013C0F901E859FF4F8081893351
+:1004800059F404C02F5F3F4F81818193273031059C
+:10049000CCF310926F0041502F5F3F4F842F90E0BC
+:1004A0002817390744F340936100C0E1D0E0109170
+:1004B0006700112309F4B0CF053010F00550ACCF20
+:1004C00080916600882321F082E6F4DE10926600B7
+:1004D0008091810084FF9FCF88E690E068E094D20D
+:1004E0009ACFDF93CF93CDB7DEB728970FB6F894A6
+:1004F000DEBF0FBECDBF982F8091810084FFFCCF5F
+:10050000FE01319688E0DF011D928A95E9F7998313
+:100510006B83CF0168E078D228960FB6F894DEBFDF
+:100520000FBECDBFCF91DF910895A82FB92F80E0E6
+:1005300090E041E050EA609530E009C02D918227BB
+:100540009795879510F084279527305EC8F36F5FE5
+:10055000A8F30895EADF8D939D930895CF93CFB7C5
+:10056000CF93DF93C395859BE9F7859B0BC0859B54
+:1005700009C0859B07C0859B05C0859B03C0859BE3
+:1005800001C08BC06F93C0918F00DD27CA56DF4F2B
+:100590002F9365E5859B03C02F916F91E6CF0F9355
+:1005A0001F934F9320E040E15F9300B3047205FB7B
+:1005B00027F93F9350E03BE039C0147240642F7735
+:1005C000012F5F5F1EC0406810B314722F77525026
+:1005D0001FC0406400B32F770472D1F15F5F00C089
+:1005E00023C0406210B32F77147291F15F5F00C097
+:1005F00025C004721027515012F45D5F00001150A5
+:1006000027952C3F10B3C8F6147201270150279587
+:100610002C3FC8F64227499300B3047210274F734A
+:10062000115027952C3FA8F64695469510B31472A5
+:1006300079F00127015027952C3F98F66B5A60F30B
+:10064000315000B3B0F600C010E41ABF002719C043
+:100650003B503195C31BD04010E41ABF0881033CC6
+:1006600009F10B34F9F020918D001981110F12134B
+:10067000EDCF4A81441F093651F10D3211F0013E90
+:1006800029F7009394003F915F914F911F910F9133
+:100690002F916F91CAB7C6FD65CFDF91CF91CFBFC4
+:1006A000CF91189520919400222369F31091920024
+:1006B000112391F5343092F13093920020938E0003
+:1006C00010918F003BE0311B30938F0027C00091C9
+:1006D000920001300CF50AE54F7049F43091620048
+:1006E00034FD1DC000936200C6E7D0E01CC030910D
+:1006F000810034FD14C000938100C2E8D0E013C033
+:10070000052710E000C0000002BB1AC0052710E05A
+:10071000221F1DC010E021C04AE502C032ED432F68
+:10072000C4E1D0E032E011B31462959A02B311BB78
+:1007300054E220E865E320FF052702BB27951795C3
+:100740001C3FF0F66695B8F7B1F720FF052702BB0E
+:10075000279517951C3FD0F62795179517FF052766
+:1007600000001C3F02BBB0F629913A9519F70B7DAA
+:1007700010919300110FC651D04002BB11F010939D
+:100780008D0010E41ABF006211B31B7D402F4B7D1A
+:1007900054E05A95F1F702BB11BB42BB74CF85B749
+:1007A000836085BF8BB780648BBF8BE480938200AE
+:1007B0008AE58093810008951F93CF93DF93609122
+:1007C0009200635067FDC4C080918F00CCE0D0E000
+:1007D000C81BD109CA56DF4F80918E008D3209F0B7
+:1007E000A4C0683009F0B2C083EC809376008AE53B
+:1007F00080936200109270008881807641F0CE0173
+:100800000E94A101282F8F3F09F47EC084C09A81E5
+:1008100010927F008981882321F41092800022E0C9
+:100820006CC0853019F49093930066C0863009F04F
+:100830004FC08B81813041F48BE191E09093910026
+:100840008093900022E140C0823041F48DE291E03B
+:10085000909391008093900022E236C08330F9F4A7
+:100860008A81882341F48DED90E0909391008093EC
+:10087000900024E029C0813041F481EE90E0909313
+:1008800091008093900024E21FC08230E1F485E063
+:1008900091E0909391008093900026E115C0813201
+:1008A00041F48FE391E0909391008093900029E0D0
+:1008B0000BC0823241F48EE990E0909391008093D6
+:1008C00090002FE301C020E080E48093700023C0FB
+:1008D000883021F421E085E990E011C0893019F4D5
+:1008E0009093950009C08A3011F421E006C08B3046
+:1008F00019F48BE48093820020E08FE790E09093DE
+:1009000091008093900007C0888187FD2E8180E848
+:100910008093700006C08F81882319F48E8182171E
+:1009200008F0822F8093630011C08091700087FFD0
+:100930000DC0CE010E94DC018F3F21F48EE1809337
+:10094000620004C0882311F010926300109292009C
+:100950008091620084FF4AC0809163008F3F09F458
+:1009600045C0182F893008F018E0811B8093630080
+:100970008091760098E8892780937600112341F1D1
+:1009800020919000309191008091700086FF0DC001
+:10099000A7E7B0E080E090E0F901E80FF91FE491EB
+:1009A000ED9301961817C1F708C0912FD901E7E719
+:1009B000F0E08D9181939150E1F71150812F90E0FB
+:1009C0001F5F0196820F931F909391008093900078
+:1009D00087E790E0612F0E94AA02612F6C5F6C3064
+:1009E00019F08FEF809363006093620094E180B30D
+:1009F000847231F49150D9F71092930010928D00C7
+:100A0000DF91CF911F9108951F93DC01162F8091E4
+:100A1000810084FF07C08091820098E88927809335
+:100A2000820003C08AE580938100912FE3E8F0E023
+:100A30008D91819391501916DCF383E890E0612F3A
+:100A40000E94AA021C5F109381001F910895F894E0
+:020A5000FFCFD6
+:040A520001025AFF44
 :00000001FF
Index: aktousb/code/main.c
===================================================================
--- aktousb/code/main.c	(revision 49fd394986aa947808c9037bb0ef5135663b4329)
+++ aktousb/code/main.c	(revision ff4dbfdb21acb1d89de7181dfb2953800c7b066e)
@@ -45,4 +45,5 @@
 	else
 		modifier = MOD_NONE;
+
 	if (key != KEY_Reserved && reportIndex < 8) {
 		reportBuffer[reportIndex] = key; // set next available entry
@@ -64,5 +65,12 @@
 	else
 		modifier = MOD_NONE;
-	if (key != KEY_Reserved) {
+
+	if (key == KEY_capslock) {
+		if (reportIndex < 8) {
+			reportBuffer[reportIndex] = key; // set next available entry
+			reportIndex++;
+			pressingCaps = 1;
+		}
+	} else if (key != KEY_Reserved) {
 		for (i = 2; i < reportIndex; i++) {
 			if (reportBuffer[i] == key) {
@@ -91,4 +99,5 @@
 	uint8_t idleCounter = 0;
     uint8_t updateNeeded = 0;
+	int capsDelay = 16;
 
 	wdt_enable(WDTO_2S);
@@ -97,6 +106,5 @@
 
 	//debug LED - output
-	DDRC |= (1<<PC5);
-	DDRC |= (1<<PC4);
+	DDRD |= (1<<PD6);
 
 	// Keyboard
@@ -117,6 +125,4 @@
 		if (char_waiting) {
 			key_code = ak_read_scancode();
-			PORTC ^= (1<<PC4);
-			PORTC ^= (1<<PC5);
 			// if an update is needed, send the report
 			if ((key_code & 1) == 0)
@@ -128,7 +134,32 @@
 		}
 
+
 		// check timer if we need periodic reports
 		if (TIFR & (1 << TOV0)) {
 			TIFR = (1 << TOV0); // reset flag
+
+			// PORTD ^= (1<<PD6); // blink del : we are alive !
+			if (pressingCaps)
+				PORTD |= 1<<PD6;
+			else
+				PORTD &= ~(1<<PD6);
+
+			if (pressingCaps) {
+				if (--capsDelay == 0) {
+					capsDelay = 16;
+					pressingCaps = 0;
+
+					int i;
+					for (i = 2; i < reportIndex; i++) {
+						if (reportBuffer[i] == KEY_capslock) {
+							for (; i < 7; i++)
+								reportBuffer[i] = reportBuffer[i+1];
+							reportBuffer[7] = 0;
+							reportIndex--;
+						}
+					}				
+				}
+			}
+
 			if (idleRate != 0) { // do we need periodic reports?
 				if(idleCounter > 4){ // yes, but not yet
