-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.ino
62 lines (51 loc) · 1.37 KB
/
template.ino
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
/******************************************************/
/* Made by Bane34 */
/* https://github.com/Bane34 */
/* I am not responsible of what you do with this code */
/******************************************************/
#include <Keyboard.h>
void start(){
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
Keyboard.begin();
////////////EXAMPLE/////////////
Execute();
Write("powershell");
Return();
Write("echo ducky script working :)");
///PUT YOUR OWN CODE DOWN HERE///
Keyboard.end(); //Do not delete this, otherwise the keyboard will get crazy
digitalWrite(LED_BUILTIN, LOW);
}
void loop(){
// Dont put anything here
}
void Return(){
//Use this to press intro
Keyboard.press(KEY_RETURN);
delay(500);
Keyboard.release(KEY_RETURN);
delay(500);
}
void Close(){
// ALT + F4 (close shortcut)
Keyboard.press(KEY_LEFT_ALT);
Keyboard.press(KEY_F4);
delay(500);
Keyboard.release(KEY_LEFT_ALT);
Keyboard.release(KEY_F4);
delay(500);
}
void Write(char txt[]){
Keyboard.print(txt);
delay(500);
}
void Execute(){
// WINDOWS KEY + r
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press('r');
delay(500);
Keyboard.release(KEY_LEFT_GUI);
Keyboard.release('r');
delay(500);
}