forked from BrendanBard/bundy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconvert.php
422 lines (418 loc) · 6.65 KB
/
convert.php
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
<?php
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
$fh = fopen('data.txt','w'); //File to write to
$fs = fopen('tester.txt', 'r'); //File to retrieve from
while ($line = fgets($fs)) {
$decnum = intval($line);
switch ($decnum)
{
case 1:
fwrite($fh, "\nLBUTTON");
break;
case 2:
fwrite($fh, "\nRBUTTON");
break;
case 3:
fwrite($fh, "\nCANCEL");
break;
case 4:
fwrite($fh, "\nMBUTTON");
break;
case 5:
fwrite($fh, "\nXBUTTON1");
break;
case 6:
fwrite($fh, "\nXBUTTON2");
break;
case 8:
fwrite($fh, "\nBACKSPACE");
break;
case 9:
fwrite($fh, "\nTAB");
break;
case 12:
fwrite($fh, "\nCLEAR");
break;
case 13:
fwrite($fh, "\n ");
break;
case 16:
fwrite($fh, "\nSHIFT");
break;
case 17:
fwrite($fh, "\nCTRL");
break;
case 18:
fwrite($fh, "\nALT");
break;
case 19:
fwrite($fh, "\nPAUSE");
break;
case 20:
fwrite($fh, "\nCAPS_LOCK");
break;
case 21:
fwrite($fh, "\nHangul mode");
break;
case 23:
fwrite($fh, "\nJunja Mode");
break;
case 24:
fwrite($fh, "\nfinal mode");
break;
case 25:
fwrite($fh, "\nHanja Mode");
break;
case 27:
fwrite($fh, "\nESC");
break;
case 28:
fwrite($fh, "\nconvert");
break;
case 29:
fwrite($fh, "\nnonconvert");
break;
case 30:
fwrite($fh, "\naccept");
break;
case 31:
fwrite($fh, "\nmode change");
break;
case 32:
fwrite($fh, "\n ");
break;
case 33:
fwrite($fh, "\nPGUP");
break;
case 34:
fwrite($fh, "\nPGDN");
break;
case 35:
fwrite($fh, "\nEND");
break;
case 36:
fwrite($fh, "\nHOME");
break;
case 37:
fwrite($fh, "\nL ARROW");
break;
case 38:
fwrite($fh, "\nUP ARROW");
break;
case 39:
fwrite($fh, "\nR ARROW");
break;
case 40:
fwrite($fh, "\nDOWN ARROW");
break;
case 41:
fwrite($fh, "\nSELECT");
break;
case 42:
fwrite($fh, "\nPRINT");
break;
case 43:
fwrite($fh, "\nEXECUTE");
break;
case 44:
fwrite($fh, "\nPRINT SCREEN");
break;
case 45:
fwrite($fh, "\nINS");
break;
case 46:
fwrite($fh, "\nDELETE");
break;
case 47:
fwrite($fh, "\nHELP");
break;
case 48:
fwrite($fh, "\n0");
break;
case 49:
fwrite($fh, "\n1");
break;
case 50:
fwrite($fh, "\n2");
break;
case 51:
fwrite($fh, "\n3");
break;
case 52:
fwrite($fh, "\n4");
break;
case 53:
fwrite($fh, "\n5");
break;
case 54:
fwrite($fh, "\n6");
break;
case 55:
fwrite($fh, "\n7");
break;
case 56:
fwrite($fh, "\n8");
break;
case 57:
fwrite($fh, "\n9");
break;
case 65:
fwrite($fh, "\nA");
break;
case 66:
fwrite($fh, "\nB");
break;
case 67:
fwrite($fh, "\nC");
break;
case 68:
fwrite($fh, "\nD");
break;
case 69:
fwrite($fh, "\nE");
break;
case 70:
fwrite($fh, "\nF");
break;
case 71:
fwrite($fh, "\nG");
break;
case 72:
fwrite($fh, "\nH");
break;
case 73:
fwrite($fh, "\nI");
break;
case 74:
fwrite($fh, "\nJ");
break;
case 75:
fwrite($fh, "\nK");
break;
case 76:
fwrite($fh, "\nL");
break;
case 77:
fwrite($fh, "\nM");
break;
case 78:
fwrite($fh, "\nN");
break;
case 79:
fwrite($fh, "\nO");
break;
case 80:
fwrite($fh, "\nP");
break;
case 81:
fwrite($fh, "\nQ");
break;
case 82:
fwrite($fh, "\nR");
break;
case 83:
fwrite($fh, "\nS");
break;
case 84:
fwrite($fh, "\nT");
break;
case 85:
fwrite($fh, "\nU");
break;
case 86:
fwrite($fh, "\nV");
break;
case 87:
fwrite($fh, "\nW");
break;
case 88:
fwrite($fh, "\nX");
break;
case 89:
fwrite($fh, "\nY");
break;
case 90:
fwrite($fh, "\nZ");
break;
case 91:
fwrite($fh, "\nLWINDOWS KEY");
break;
case 92:
fwrite($fh, "\nRWINDOWS KEY");
break;
case 93:
fwrite($fh, "\nAPPS KEY");
break;
case 95:
fwrite($fh, "\nSLEEP");
break;
case 96:
fwrite($fh, "\n0");
break;
case 97:
fwrite($fh, "\n1");
break;
case 98:
fwrite($fh, "\n2");
break;
case 99:
fwrite($fh, "\n3");
break;
case 100:
fwrite($fh, "\n4");
break;
case 101:
fwrite($fh, "\n5");
break;
case 102:
fwrite($fh, "\n6");
break;
case 103:
fwrite($fh, "\n7");
break;
case 104:
fwrite($fh, "\n8");
break;
case 105:
fwrite($fh, "\n9");
break;
case 106:
fwrite($fh, "\n*");
break;
case 107:
fwrite($fh, "\n+");
break;
case 108:
fwrite($fh, "\nSEP");
break;
case 109:
fwrite($fh, "\n-");
break;
case 110:
fwrite($fh, "\n.");
break;
case 111:
fwrite($fh, "\n/");
break;
case 112:
fwrite($fh, "\nF1");
break;
case 113:
fwrite($fh, "\nF2");
break;
case 114:
fwrite($fh, "\nF3");
break;
case 115:
fwrite($fh, "\nF4");
break;
case 116:
fwrite($fh, "\nF5");
break;
case 117:
fwrite($fh, "\nF6");
break;
case 118:
fwrite($fh, "\nF7");
break;
case 119:
fwrite($fh, "\nF8");
break;
case 120:
fwrite($fh, "\nF9");
break;
case 121:
fwrite($fh, "\nF10");
break;
case 122:
fwrite($fh, "\nF11");
break;
case 123:
fwrite($fh, "\nF12");
break;
case 124:
fwrite($fh, "\nF13");
break;
case 125:
fwrite($fh, "\nF14");
break;
case 126:
fwrite($fh, "\nF15");
break;
case 127:
fwrite($fh, "\nF16");
break;
case 128:
fwrite($fh, "\nF17");
break;
case 129:
fwrite($fh, "\nF18");
break;
case 130:
fwrite($fh, "\nF19");
break;
case 131:
fwrite($fh, "\nF20");
break;
case 132:
fwrite($fh, "\nF21");
break;
case 133:
fwrite($fh, "\nF22");
break;
case 134:
fwrite($fh, "\nF23");
break;
case 135:
fwrite($fh, "\nF24");
break;
case 144:
fwrite($fh, "\nNUM LOCK");
break;
case 145:
fwrite($fh, "\nSCROLL LOCK");
break;
case 160:
fwrite($fh, "\nLSHIFT");
break;
case 161:
fwrite($fh, "\nRSHIFT");
break;
case 162:
fwrite($fh, "\nLCTRL");
break;
case 163:
fwrite($fh, "\nRCTRL");
break;
case 164:
fwrite($fh, "\nLMENU");
break;
case 165:
fwrite($fh, "\nRMENU");
break;
default:
fwrite($fh, $line);
}
}
fclose($fh);
fclose($fs);
header('Location: data.php');
}
else{
?>
<!doctype html>
<html>
<style>
.btnSubmit {
padding: 10px 20px;
background: #B9081C;
border: #F13D24 1px solid;
color: #FFF;
}
</style>
<body>
<form name="frmUser" method="POST" action="">
<input type="submit" name="submit" value="Submit" class="btnSubmit">
</form>
</body>
</html><?php } ?>