forked from esc0rtd3w/firestick-loader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eventmap.cmd
388 lines (338 loc) · 5.86 KB
/
eventmap.cmd
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
@echo off
title Android Event Keymap Script [Pulled From ADB Toolkit] [esc0rtd3w]
color 0b
::mode con lines=50
:reset
:: Setting ADB variables
:set_var
set get="%~dp0bin\adb.exe" shell input keyevent
set gettxt="%~dp0bin\adb.exe" shell input text
set inifile="%~dp0bin\inifile.exe"
::call "scripts\get_info_bar.cmd"
:: Old (ORIGINAL) keymap
:: Setting variables for all known events
::set KEYCODE_UNKNOWN=0
::set KEYCODE_MENU=1
::set KEYCODE_SOFT_RIGHT=2
::set KEYCODE_HOME=3
::set KEYCODE_BACK=4
::set KEYCODE_CALL=5
::set KEYCODE_ENDCALL=6
::set KEYCODE_0=7
::set KEYCODE_1=8
::set KEYCODE_2=9
::set KEYCODE_3=10
::set KEYCODE_4=11
::set KEYCODE_5=12
::set KEYCODE_6=13
::set KEYCODE_7=14
::set KEYCODE_8=15
::set KEYCODE_9=16
::set KEYCODE_STAR=17
::set KEYCODE_POUND=18
::set KEYCODE_DPAD_UP=19
::set KEYCODE_DPAD_DOWN=20
::set KEYCODE_DPAD_LEFT=21
::set KEYCODE_DPAD_RIGHT=22
::set KEYCODE_DPAD_CENTER=23
::set KEYCODE_VOLUME_UP=24
::set KEYCODE_VOLUME_DOWN=25
::set KEYCODE_POWER=26
::set KEYCODE_CAMERA=27
::set KEYCODE_CLEAR=28
::set KEYCODE_A=29
::set KEYCODE_B=30
::set KEYCODE_C=31
::set KEYCODE_D=32
::set KEYCODE_E=33
::set KEYCODE_F=34
::set KEYCODE_G=35
::set KEYCODE_H=36
::set KEYCODE_I=37
::set KEYCODE_J=38
::set KEYCODE_K=39
::set KEYCODE_L=40
::set KEYCODE_M=41
::set KEYCODE_N=42
::set KEYCODE_O=43
::set KEYCODE_P=44
::set KEYCODE_Q=45
::set KEYCODE_R=46
::set KEYCODE_S=47
::set KEYCODE_T=48
::set KEYCODE_U=49
::set KEYCODE_V=50
::set KEYCODE_W=51
::set KEYCODE_X=52
::set KEYCODE_Y=53
::set KEYCODE_Z=54
::set KEYCODE_COMMA=55
::set KEYCODE_PERIOD=56
::set KEYCODE_ALT_LEFT=57
::set KEYCODE_ALT_RIGHT=58
::set KEYCODE_SHIFT_LEFT=59
::set KEYCODE_SHIFT_RIGHT=60
::set KEYCODE_TAB=61
::set KEYCODE_SPACE=62
::set KEYCODE_SYM=63
::set KEYCODE_EXPLORER=64
::set KEYCODE_ENVELOPE=65
::set KEYCODE_ENTER=66
::set KEYCODE_DEL=67
::set KEYCODE_GRAVE=68
::set KEYCODE_MINUS=69
::set KEYCODE_EQUALS=70
::set KEYCODE_LEFT_BRACKET=71
::set KEYCODE_RIGHT_BRACKET=72
::set KEYCODE_BACKSLASH=73
::set KEYCODE_SEMICOLON=74
::set KEYCODE_APOSTROPHE=75
::set KEYCODE_SLASH=76
::set KEYCODE_AT=77
::set KEYCODE_NUM=78
::set KEYCODE_HEADSETHOOK=79
::set KEYCODE_FOCUS=80
::set KEYCODE_PLUS=81
::set KEYCODE_MENU=82
::set KEYCODE_NOTIFICATION=83
::set KEYCODE_SEARCH=84
::set TAG_LAST_KEYCODE=85
:: New keymap
:: Setting variables for all known events
set UNKNOWN=0
set MENU=1
set SOFT_RIGHT=2
set HOME=3
set BACK=4
set CALL=5
set ENDCALL=6
set 0=7
set 1=8
set 2=9
set 3=10
set 4=11
set 5=12
set 6=13
set 7=14
set 8=15
set 9=16
set STAR=17
set POUND=18
set DPAD_UP=19
set DPAD_DOWN=20
set DPAD_LEFT=21
set DPAD_RIGHT=22
set DPAD_CENTER=23
set VOLUME_UP=24
set VOLUME_DOWN=25
set POWER=26
set CAMERA=27
set CLEAR=28
set A=29
set B=30
set C=31
set D=32
set E=33
set F=34
set G=35
set H=36
set I=37
set J=38
set K=39
set L=40
set M=41
set N=42
set O=43
set P=44
set Q=45
set R=46
set S=47
set T=48
set U=49
set V=50
set W=51
set X=52
set Y=53
set Z=54
set COMMA=55
set PERIOD=56
set ALT_LEFT=57
set ALT_RIGHT=58
set SHIFT_LEFT=59
set SHIFT_RIGHT=60
set TAB=61
set SPACE=62
set SYM=63
set EXPLORER=64
set ENVELOPE=65
set ENTER=66
set DEL=67
set GRAVE=68
set MINUS=69
set EQUALS=70
set LEFT_BRACKET=71
set RIGHT_BRACKET=72
set BACKSLASH=73
set SEMICOLON=74
set APOSTROPHE=75
set SLASH=76
set AT=77
set NUM=78
set HEADSETHOOK=79
set FOCUS=80
set PLUS=81
set MENU=82
set NOTIFICATION=83
set SEARCH=84
set TAG_LAST_KEYCODE=85
:startnow
echo.
echo.
echo UNKNOWN=0
echo MENU=1
echo SOFT_RIGHT=2
echo HOME=3
echo BACK=4
echo CALL=5
echo ENDCALL=6
echo 0=7
echo 1=8
echo 2=9
echo 3=10
echo 4=11
echo 5=12
echo 6=13
echo 7=14
echo 8=15
echo 9=16
echo STAR=17
echo POUND=18
echo DPAD_UP=19
echo DPAD_DOWN=20
echo DPAD_LEFT=21
echo DPAD_RIGHT=22
echo DPAD_CENTER=23
echo VOLUME_UP=24
echo VOLUME_DOWN=25
echo POWER=26
echo CAMERA=27
echo CLEAR=28
echo A=29
echo B=30
echo C=31
echo D=32
echo E=33
echo F=34
echo G=35
echo H=36
echo I=37
echo J=38
echo K=39
echo L=40
echo M=41
echo N=42
echo O=43
echo P=44
echo Q=45
echo R=46
echo S=47
echo T=48
echo U=49
echo V=50
echo W=51
echo X=52
echo Y=53
echo Z=54
echo COMMA=55
echo PERIOD=56
echo ALT_LEFT=57
echo ALT_RIGHT=58
echo SHIFT_LEFT=59
echo SHIFT_RIGHT=60
echo TAB=61
echo SPACE=62
echo SYM=63
echo EXPLORER=64
echo ENVELOPE=65
echo ENTER=66
echo DEL=67
echo GRAVE=68
echo MINUS=69
echo EQUALS=70
echo LEFT_BRACKET=71
echo RIGHT_BRACKET=72
echo BACKSLASH=73
echo SEMICOLON=74
echo APOSTROPHE=75
echo SLASH=76
echo AT=77
echo NUM=78
echo HEADSETHOOK=79
echo FOCUS=80
echo PLUS=81
echo MENU=82
echo NOTIFICATION=83
echo SEARCH=84
echo TAG_LAST_KEYCODE=85
echo.
echo.
echo Scroll up to see a list of available events.
echo.
echo Last Executed Event: %command%
echo.
echo.
echo Enter next event (number or name) and press ENTER:
echo.
echo Examples: HOME (3), MENU (1), BACK (4), SEARCH (84)
echo.
echo.
echo Type "text" without quotes to send text strings to phone
::echo.
::echo Type "exit" without quotes to close script
echo.
echo.
set event=0
set /p event=
if %event%==0 goto startnow
if %event%==text goto txtmode
if %event%==exit goto end
::if %event% gtr 85 goto startnow
goto bycmd
:txtmode
cls
echo Enter text to send (no spaces):
echo.
set event=0
set /p event=
if %event%==0 goto txtmode
%gettxt% "%event%"
goto startnow
:bycmd
cls
%inifile% "eventmap.ini" [%event%] command
for /f "delims=" %%a in ('%inifile% "eventmap.ini" [%event%] command') do %%a
if not defined command goto bynum
goto execute
:bynum
%inifile% "eventmap.ini" [%event%] number
for /f "delims=" %%b in ('%inifile% "eventmap.ini" [%event%] number') do %%b
:: Swip Swap of variables (makes crap work)
set event_=%event%
set number_=%number%
set event=%number_%
set number=%event_%
set command=%number%
goto execute
:: For writing new INI
::echo [%command%] >> tmp.txt
::echo number=%event% >> tmp.txt
::echo. >> tmp.txt
:execute
cls
echo COMMAND IS DEFINED AS %command%
echo.
echo.
%get% %event%
::pause
goto startnow
:end