-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
auto-hot-key.ahk
265 lines (230 loc) · 5.02 KB
/
auto-hot-key.ahk
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
#keyhistory
#noenv
#singleinstance force
#installmousehook
#installkeybdhook
setbatchlines -1
listlines off
sendmode input
setworkingdir %a_scriptdir%
CoordMode, Mouse, Screen
;#Persistent
;#InstallKeybdHook
;KeyHistory
printscreen::f14
insert::f15
delete::f16
home::f17
end::f18
pgup::f19
pgdn::f20
left::f21
up::f22
down::f23
right::f24
^f14::
DllCall("PowrProf\SetSuspendState", "Int", 0, "Int", 0, "Int", 0)
return
^f15::
Run, shutdown.exe /r /t 0
Return
^f16::
Run, shutdown /s /t 0
Return
sc056::rcontrol
appskey::rcontrol
#wheeldown::volume_up
#wheelup::volume_down
numpadenter::f14
#include, %a_scriptdir%\lib\timelineclick.ahk
#include, %a_scriptdir%\lib\snippets.ahk
#ifwinactive, ahk_exe onecommander.exe
!s::send ^{tab}
!w::send ^+{tab}
#ifwinactive
#ifwinactive, ahk_exe resolve.exe
f13:: ;change hotkey to desired hotkey
timelineclick(["\imagesearch\resolve\editpage.png", "\imagesearch\resolve\fairlight.png", "\imagesearch\resolve\cutpage.png"], [75,63,45])
return
WheelUp::
Send , {Left}
Return
#ifwinactive
#ifwinactive ahk_exe zen.exe
f1::^+t
f2::^w
f3::
send ^c
sleep, 50
send ^t
sleep, 50
send ^v
send {enter}
return
f4::
send ^c
sleep, 50
send ^t
sleep, 50
send y{space}
send ^v
sleep, 50
send {enter}
return
^o::^+a
!w::send ^{pgup}
!s::send ^{pgdn}
f13::send ^t
f7::^+b
#ifwinactive
#ifwinactive ahk_exe windowsterminal.exe
f3::^+t
f2::^+w
!w::send ^{pgup}
!s::send ^{pgdn}
f13 & l::send !{right}
f13 & h::send !{left}
f13 & j::send !{down}
f13 & k::send !{up}
f13::^+t
#ifwinactive
#ifwinactive ahk_exe obsidian.exe
f1::+1
f13::p
#ifwinactive
movingwindowtootherdisplay() {
send #+{left}
sysget, monitors, monitorcount
sysget, monitorcount, monitorcount
sysget, monitorprimary, monitorprimary
current := 0
loop, %monitorcount%
{
sysget, monitor, monitor, %a_index%
coordmode, mouse, screen
mousegetpos, mousex, mousey
if ( (mousex >= monitorleft) && (mousex < monitorright) && (mousey >= monitortop) && (mousey < monitorbottom) )
{
current := a_index
currentrx := (mousex - monitorleft) / (monitorright - monitorleft)
currentry := (mousey - monitortop) / (monitorbottom - monitortop)
break
}
}
next := current + 1
if (next > monitorcount)
next := 1
sysget, monitor, monitor, %next%
newx := monitorleft + currentrx*(monitorright - monitorleft)
newy := monitortop + currentry*(monitorbottom - monitortop)
dllcall("setcursorpos", "int", newx, "int", newy)
dllcall("setcursorpos", "int", newx, "int", newy)
}
JumpCursorBetweenMonitors() {
MouseGetPos, MouseX, MouseY ; Get current mouse position
SysGet, MonitorCount, MonitorCount ; Get number of monitors
if (MonitorCount < 2) {
MsgBox, You need at least two monitors for this script to work.
return
}
; Get dimensions of both monitors
SysGet, M1, Monitor, 1
SysGet, M2, Monitor, 2
; Determine which monitor the mouse is currently on
if (MouseX >= M1Left && MouseX <= M1Right && MouseY >= M1Top && MouseY <= M1Bottom) {
; Move to monitor 2
NewX := MouseX - M1Left + M2Left
NewY := MouseY - M1Top + M2Top
MouseMove, NewX, NewY
} else {
; Move to monitor 1
NewX := MouseX - M2Left + M1Left
NewY := MouseY - M2Top + M1Top
MouseMove, NewX, NewY
}
}
togglemaxwindow()
{
winget, winstate, minmax, a
if (winstate = 1)
{
winrestore, a
}
else
{
winmaximize, a
}
}
tab & e::run, "c:\users\master\editing\projects\"
tab & w::run, "c:\users\master\downloads\"
tab & r::run, "e:\render\"
tab & t::run, "C:\Users\master\Pictures"
tab & 2::run, "e:\obs\"
tab & 3::run, "E:\phone\Camera\Camera"
tab::tab
space & ,::pgup
space & -::volume_down
space & =::volume_up
space & [::send !{left}
space & ]::send !{right}
space & `::send ^{wheelup}
space & b::browser_back
space & c::#Tab
space & d::bs
space & e::down
space & esc::send !{f4}
space & h::left
space & i::home
space & j::down
space & k::up
space & l::right
space & m::pgdn
space & n::^t
space & o::end
space & p::send ^{pgdn}
space & q::left
space & r::right
space & tab::send ^{wheeldown}
space & u::send ^{pgup}
space & v::send #!+v
space & w::up
space & x::del
space & z::^z
space & g::#tab
space & f13::
movingwindowtootherdisplay()
JumpCursorBetweenMonitors()
return
space & 1::send ^#1
space & 2::send ^#2
space & 3::send ^#3
space & 4::send ^#4
space & 5::send ^#5
space & f1::send #^6
space & f2::send #^7
space & f3::send #^8
space & f4::send #^9
space & f5::send #^0
Space & f6::send #+s
space & f9::reload
space::send {space}
+space::send +{space}
!space::send !{space}
#space::send #{space}
^space::send ^{space}
`; & d::
send +v
send {del}
return
`; & j::
send +v
send ^+,
return
`; & l::
send +v
send ^+.
return
`;::send {;}
+`;::send +{;}
!`;::send !{;}
#`;::send #{;}