-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathz233vl.txt
More file actions
149 lines (126 loc) · 3.93 KB
/
z233vl.txt
File metadata and controls
149 lines (126 loc) · 3.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
Z233VL
"Mozilla/5.0 (Linux; Android 5.1.1; Z233VL Build/LMY47V; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/45.0.2454.95 Mobile Safari/537.36"
LSK no event
RSK no event
camera no event
# key, long tap only, OS conflict
* key, long tap only, OS conflict
Z233VL.json IS broken..... CODE 229 IS COMPOSE/UNKNOWN KEY
HTTP URL to JSON
var i = {}; s.replace(/([^\n]+)\n\/keyup\?([^\n]+)/g, function(m, m1, m2){debugger; i[m1]=JSON.parse(atob(m2)); return '1';})
clean out same keys
n = {};
Object.keys(i).forEach(function(kbdkey) {
Object.keys(i[kbdkey]).forEach(function(kprop) {
var curval = i[kbdkey][kprop];
Object.keys(i).forEach(function(kbdkey2) {
if(i[kbdkey2][kprop] != curval){(n[kbdkey]=n[kbdkey]||{})[kprop] = curval}
})
})
})
event hook HTML
<script>document.addEventListener('keyup', function(e){var a=[]; var j={}; for (i in e) {
a.push(i+"="+e[i]);j[i]=e[i].toString()
};fetch('/keyup?'+btoa(JSON.stringify(j))); alert(a.sort().join(' '));if(/^\d+$/.test(e.key)){document.querySelector('[accesskey="'+e.key+'"]').click()}})</script>
function evth (e) {
var a = [];
var j = {};
for (i in e) {
a.push(i + "=" + e[i]);
j[i] = e[i] !== null ? e[i].toString() : null;
};
var k = ['keyCode', 'which', 'keyIdentifier', 'charCode'
];
fetch('/'+e.type+'?'+k.map(function(k){return k+'='+e[k]}).join('&')+'&nX='+String.fromCharCode(e.keyCode));
// fetch('/keyup?' + btoa(JSON.stringify(j)));
// alert(a.sort().join(' '));
// if (/^\d+$/.test(e.key)) {
// document.querySelector('[accesskey="' + e.key + '"]').click()
// }
}
function kph(e) {
var realkey;
switch (e.keyCode) {
case 38: //up arrow
realkey = 'Up';
break;
case 39: //right arrow
realkey = 'Right';
break;
case 40: //down arrow
realkey = 'Down';
break;
case 37: //left arrow
realkey = 'Left';
break;
case 13: //center
realkey = 'Enter';
break;
case 8: //C button
realkey = "Backspace";
break;
case 49: //asci 1
realkey = 1;
break;
case 50: //asci 2
case 65: //asci A
case 97: //asci a
realkey = 2;
break
case 51: //asci 3
case 68: //ascii D
case 100: //ascii d
realkey = 3;
break;
case 52: //asci 4
case 71: //asci G
case 103: //asci g
realkey = 4;
break;
case 53: //asci 5
case 74: //asci J
case 106: //asci j
realkey = 5;
break;
case 54: //asci 6
case 77: //asci M
case 109: //asci m
realkey = 6;
break;
case 55: //asci 7
case 80: //asci P
case 112: //asci p
realkey = 7;
break;
case 56: //asci 8
case 84: //asci T
case 116: //asci t
realkey = 8;
break;
case 57: //asci 9
case 87: //asci W
case 119: //asci w
realkey = 9;
break;
case 32: //asci SPACE
realkey = 0;
break;
case 190: //asci period
case 46: //asci peroid
realkey = '*';
break;
}
}
document.addEventListener('keyup', evth);
document.addEventListener('keypress', evth);
//document.addEventListener('keypress', kph);
document.addEventListener('keydown', evth);
document.addEventListener('click', evth);
document.addEventListener('compositionend', evth);
document.addEventListener('compositionstart', evth);
document.addEventListener('compositionupdate', evth);
document.addEventListener('mousedown', evth);
document.addEventListener('mouseup', evth);
document.addEventListener('touchstart', evth);
document.addEventListener('touchend', evth);
document.body.children[0].focus()