|
9 | 9 | duckyCommands = ["WINDOWS", "GUI", "APP", "MENU", "SHIFT", "ALT", "CONTROL", "CTRL", "DOWNARROW", "DOWN",
|
10 | 10 | "LEFTARROW", "LEFT", "RIGHTARROW", "RIGHT", "UPARROW", "UP", "BREAK", "PAUSE", "CAPSLOCK", "DELETE", "END",
|
11 | 11 | "ESC", "ESCAPE", "HOME", "INSERT", "NUMLOCK", "PAGEUP", "PAGEDOWN", "PRINTSCREEN", "SCROLLLOCK", "SPACE",
|
12 |
| -"TAB", "ENTER", " a", " b", " c", " d", " e", " f", " g", " h", " i", " j", " k", " l", " m", " n", " o", " p", " q", " r", " s", " t", |
13 |
| -" u", " v", " w", " x", " y", " z", " A", " B", " C", " D", " E", " F", " G", " H", " I", " J", " K", " L", " M", " N", " O", " P", |
14 |
| -" Q", " R", " S", " T", " U", " V", " W", " X", " Y", " Z", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12"] |
| 12 | +"TAB", "ENTER", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", |
| 13 | +"u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", |
| 14 | +"Q", "R", "S", "T", "U", "V", "W", "X", "Y", " Z", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12"] |
15 | 15 |
|
16 | 16 | keycodeCommands = [Keycode.WINDOWS, Keycode.GUI, Keycode.APPLICATION, Keycode.APPLICATION, Keycode.SHIFT, Keycode.ALT, Keycode.CONTROL,
|
17 | 17 | Keycode.CONTROL, Keycode.DOWN_ARROW, Keycode.DOWN_ARROW ,Keycode.LEFT_ARROW, Keycode.LEFT_ARROW, Keycode.RIGHT_ARROW, Keycode.RIGHT_ARROW,
|
|
26 | 26 | Keycode.F10, Keycode.F11, Keycode.F12]
|
27 | 27 |
|
28 | 28 | def convertLine(line):
|
| 29 | + keys = line.split(" ") |
29 | 30 | newline = []
|
30 |
| - print(line) |
31 |
| - for j in range(len(keycodeCommands)): |
32 |
| - if line.find(duckyCommands[j]) != -1: |
33 |
| - newline.append(keycodeCommands[j]) |
34 |
| - print(newline) |
| 31 | +# print("keys ", keys) |
| 32 | + |
| 33 | + for k in keys: |
| 34 | + for j in range(len(keycodeCommands)): |
| 35 | + if k == (duckyCommands[j]): |
| 36 | + newline.append(keycodeCommands[j]) |
| 37 | + |
| 38 | +# print("keys commands",newline) |
35 | 39 | return newline
|
36 | 40 |
|
37 | 41 | def runScriptLine(line):
|
|
0 commit comments