-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
164 lines (143 loc) · 2.3 KB
/
test.js
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
// Module List
var robot = require("robotjs");
const fs = require("fs");
const ioHook = require('iohook');
//////////////////
// User Variable
let recVar = "rec26"
let timerVar = 25
//////////////////
// System Variables
let receivedStop = false
let counterVar = 0
//////////////////
// Stop Listener
ioHook.on('keydown', (event) => {
console.log(event)
if (event.keycode == 88) {
receivedStop = true
ioHook.stop();
return false
}
if (event.keycode == 87) {
console.log(receivedStop)
}
});
ioHook.start();
//////////////////////
const mouseEvents = require("global-mouse-events");
console.log(mouseEvents)
mouseEvents.on("mouseup", event => {
event.mouseUp = true
console.log(event);
});
//////////////////
// Key Transpose For Windows
const keyNames = {
0: '§',
1: 'Esc',
2: '1',
3: '2',
4: '3',
5: '4',
6: '5',
7: '6',
8: '7',
9: '8',
10: '9',
11: '0',
12: '-',
13: '=',
14: 'backspace',
15: 'tab',
16: 'q',
17: 'w',
18: 'e',
19: 'r',
20: 't',
21: 'y',
22: 'u',
23: 'i',
24: 'o',
25: 'p',
26: '[',
27: ']',
28: 'enter',
29: 'Left Ctrl',
30: 'a',
31: 's',
32: 'd',
33: 'f',
34: 'g',
35: 'h',
36: 'j',
37: 'k',
38: 'l',
39: ';',
40: '\'',
41: '`',
42: 'Left Shift',
43: '\\',
44: 'z',
45: 'x',
46: 'c',
47: 'v',
48: 'b',
49: 'n',
50: 'm',
51: ',',
52: '.',
53: '/',
54: 'Right Shift',
56: 'Left Alt', // macos 'Left ⌥'
57: 'space',
58: 'CapsLock',
59: 'F1',
60: 'F2',
61: 'F3',
62: 'F4',
63: 'F5',
64: 'F6',
65: 'F7',
66: 'F8',
67: 'F9',
68: 'F10',
87: 'F11',
88: 'F12',
61010: 'Insert',
61011: 'Delete',
60999: 'Home',
61007: 'End',
61001: 'Page Up',
61009: 'Page Down',
3639: 'Print Screen',
3653: 'Pause Break',
3637: 'Num /',
55: 'Num *',
3612: 'Num Enter',
3655: 'Num Home',
3657: 'Num Page Up',
3663: 'Num End',
3665: 'Num Page Down',
57420: 'Num Center 5',
3677: 'Context Menu',
61008: 'Arrow Down',
61005: 'Arrow Right',
61003: 'Arrow Left',
61000: 'Arrow Up',
57380: 'Media Stop',
57360: 'Media Previous',
57378: 'Media Play',
57369: 'Media Next',
57390: 'Volume Down',
57392: 'Volume Up',
57376: 'Volume Mute',
3613: 'Right Ctrl',
3640: 'Right Alt', // macos 'Right ⌥'
3675: 'command', // macos 'Left ⌘'
3676: 'command', // macos 'Right ⌘'
57419: '←',
57416: '↑',
57424: '↓',
57421: '→',
}