-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathscript.ts
50 lines (40 loc) · 1.22 KB
/
script.ts
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
#!/usr/bin/env suchibot
import { Keyboard, Key, Mouse, MouseButton, stopListening } from ".";
function something(): string {
return "hi";
}
console.log("hi mom");
setTimeout(() => {
Keyboard.type("hi there");
}, 100);
// setTimeout(() => {
// console.log("stopListening");
// stopListening();
// }, 2000);
Keyboard.onDown(Key.A, (event) => {
console.log("got keydown a 1");
// if (Keyboard.isDown(Key.LEFT_SHIFT)) {
// console.log("left shift a");
// }
// if (Keyboard.isDown(Key.RIGHT_SHIFT)) {
// console.log("right shift a");
// }
// if (Keyboard.isDown(Key.LEFT_SHIFT) || Keyboard.isDown(Key.RIGHT_SHIFT)) {
// console.log("(either left or right) shift a");
// }
// console.log("left mb down:", Mouse.isDown(MouseButton.LEFT));
});
// easier way to check modifier keys since they're commonly used:
Keyboard.onDown(Key.A, (event) => {
console.log("got keydown a 2");
// if (event.modifierKeys.leftShift) {
// console.log("left shift a");
// }
// if (event.modifierKeys.rightShift) {
// console.log("right shift a");
// }
// if (event.modifierKeys.shift) {
// console.log("(either left or right) shift a");
// }
// console.log("left mb down:", event.mouseButtons.left);
});