KeyMatrixAnalyzer for TrackPoint Keyboard USB English 0B47190

Dependencies:   mbed

output

esc 0 0
f1 2 3
f2 1 3
f3 1 1
f4 1 0
f5 10 0
f6 6 0
f7 7 1
f8 7 3
f9 10 3
f10 10 5
f11 11 5
f12 13 5
home 11 3
end 14 5
ins 15 5
del 15 3
~ 0 3
1 0 5
2 2 5
3 1 5
4 4 5
5 4 3
6 5 3
7 5 5
8 6 5
9 7 5
0 8 5
- 8 3
= 6 3
bs 10 1
tab 0 1
q 0 2
w 2 2
e 1 2
r 4 2
t 4 1
y 5 1
u 5 2
i 6 2
o 7 2
p 8 2
[ 8 1
] 6 1
\ 10 4
caps 2 1
a 0 4
s 2 4
d 1 4
f 4 4
g 4 0
h 5 0
j 5 4
k 6 4
l 7 4
; 8 4
' 8 0
enter 10 6
shift 9 1
z 0 6
x 2 6
c 1 6
v 4 6
b 4 7
n 5 7
m 5 6
, 6 6
. 7 6
/ 8 7
rshift 9 6
fn 14 4
ctrl 3 3
win 13 1
alt 12 0
sp 10 7
ralt 12 7
prtsc 15 4
rctrl 3 6
pgup 15 6
up 14 0
pgdn 15 7
left 14 7
down 11 7
right 13 7

output data to key matrix

#!/usr/bin/awk -f
{
	key = $1;
	col = $2;
	row = $3;
	matrix[row, col] = key;
}
END {
	printf("|  ");
	for (col = 0; col < 16; col++) {
		printf("|S%d", col);
	}
	printf("|\n");
	for (row = 0; row < 8; row++) {
		printf("|R%d", row);
		for (col = 0; col < 16; col++) {
			printf("| %s ", matrix[row, col]);
		}
		printf("|\n");
	}
}

output data to key matrix in HTML table

#!/usr/bin/awk -f
{
	key = $1;
	col = $2;
	row = $3;
	matrix[row, col] = key;
}
END {
	printf("<table><tr><th></th>");
	for (col = 0; col < 16; col++) {
		printf("<th>S%d</th>", col);
	}
	printf("</tr>\n");
	for (row = 0; row < 8; row++) {
		printf("<tr><th>R%d</th>", row);
		for (col = 0; col < 16; col++) {
			printf("<td>%s</td>", matrix[row, col]);
		}
		printf("</tr>\n");
	}
	printf("</table>\n");
}

key matrix

S0S1S2S3S4S5S6S7S8S9S10S11S12S13S14S15
R0escf4ghf6'f5altup
R1tabf3capsty]f7[shiftbswin
R2qewruiop
R3~f2f1ctrl56=f8-f9homedel
R4adsfjkl;\fnprtsc
R513247890f10f11f12endins
R6zcxrctrlvm,.rshiftenterpgup
R7bn/spdownraltrightleftpgdn
Revision:
1:00109a338de8
Parent:
0:9ae9d1744fe4
--- a/main.cpp	Sat Mar 18 07:46:11 2017 +0000
+++ b/main.cpp	Sat Mar 18 07:47:31 2017 +0000
@@ -2,30 +2,10 @@
 #include "mbed.h"
 
 // R1 R7 R6 S9 R4 R5 S0 R2 R3 S5 S1 R0 S2 S4 S7 S8 S6 S3 S12 S13 S14 S11 S10 S15 M0 ML MM MR
-/*
-DigitalIn  r1(p20); DigitalIn  r7(p17);
-DigitalIn  r6(p19); DigitalOut s9(p16);
-DigitalIn  r4(p18); DigitalIn  r5(p15);
-DigitalOut s0(p21); DigitalIn  r2(p14);
-DigitalIn  r3(p22); DigitalOut s5(p13);
-DigitalOut s1(p23); DigitalIn  r0(p12);
-DigitalOut s2(p24); DigitalOut s4(p11);
-DigitalOut s7(p25); DigitalOut s8(p10);
-DigitalOut s6(p26); DigitalOut s3(p9);
-DigitalOut s12(p27); DigitalOut s13(p8);
-DigitalOut s14(p28); DigitalOut s11(p7);
-DigitalOut s10(p29); DigitalOut s15(p6);
-*/
 const int RPINLEN = 8;
 const int SPINLEN = 16;
 DigitalIn rpin[RPINLEN] = {p12, p20, p14, p22, p18, p15, p19, p17};
 DigitalOut spin[SPINLEN] = {p21, p23, p24, p9, p11, p13, p26, p25, p10, p16, p29, p7, p27, p8, p28, p6};
-/*
-// r0 r1 r2 r3 s0 s1 r4 r5 r6 r7 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 s14 s15 s16 s17
-// 20 17 19 16 18 15 21 14 22 13 23 12 24 11 25 10 26  9 27   8  28   7  29   6  30   5
-DigitalIn rpin[RPINLEN] = {p20, p17, p19, p16, p21, p14, p22, p13};
-DigitalOut spin[SPINLEN] = {p18, p15, p23, p12, p24, p11, p25, p10, p26, p9, p27, p8, p28, p7, p29, p6, p30, p5};
-*/
 
 Serial pc(USBTX, USBRX);