-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWindows10ShortCutWithAHK_2.ahk
More file actions
284 lines (254 loc) · 7.83 KB
/
Windows10ShortCutWithAHK_2.ahk
File metadata and controls
284 lines (254 loc) · 7.83 KB
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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
; ==============================================================================
; AutoHotkey v2 Script
; Converted from the provided v1 script.
; Corrected Vim-like movement keys to support Shift for selection.
; Ensure this file is saved as UTF-8 with BOM encoding.
; ==============================================================================
#Requires AutoHotkey v2.0
; --- Send another key (Basic) ---
; Ctrl + Right Arrow -> End
^Right::Send "{End}"
; Ctrl + Left Arrow -> Home
^Left::Send "{Home}"
; Ctrl + Shift + Right Arrow -> Shift + End
^+Right::Send "+{End}"
; Ctrl + Shift + Left Arrow -> Shift + Home
^+Left::Send "+{Home}"
; Ctrl + Backspace -> Delete
^BackSpace::Send "{Delete}"
; --- Send another key (Advance) ---
; The following section using the Input command is complex to directly convert
; and might require using InputHook() in v2. Commented out for now.
; If you need this functionality, please describe the exact desired behavior.
; Original v1 code:
;~^q::
; Input, inputText, I L1 T0.5, ^q
; IfInString, ErrorLevel, EndKey:
; {
; Send, !{F4}
; }
;Return
; --- Run app. and functions ---
; Reload Script (Shift + Alt + R)
+!r::Reload()
; Open this script in VS Code (Shift + Alt + E)
; Note: Update the paths if VS Code or the script location is different.
+!e::
{
vsCodePath := "C:\Users\mnaoy\AppData\Local\Programs\Microsoft VS Code\Code.exe" ; Update if necessary
scriptPath := A_ScriptFullPath ; Use built-in variable for the current script path
Run(Format('"{}" "{}"', vsCodePath, scriptPath))
}
; Toggle AlwaysOnTop for the window under the mouse (Shift + Alt + L)
+!l::
{
MouseGetPos ,, &mouseWinID ; Use MouseGetPos() function, get window ID
if mouseWinID ; Check if a valid window ID was retrieved
WinSetAlwaysOnTop("Toggle", mouseWinID) ; Use WinSetAlwaysOnTop() function
}
; --- Vim-like movement with Muhenkan (sc07B) key ---
; Note: Using scan codes like sc07B should still work in v2,
; but using vk/sc names or virtual key names is often preferred if possible.
; sc07B corresponds to the 'Muhenkan' key on Japanese keyboards.
sc07B & h::
{
if GetKeyState("Shift")
Send "+{Left}"
else
Send "{Left}"
}
sc07B & j::
{
if GetKeyState("Shift")
Send "+{Down}"
else
Send "{Down}"
}
sc07B & k::
{
if GetKeyState("Shift")
Send "+{Up}"
else
Send "{Up}"
}
sc07B & l::
{
if GetKeyState("Shift")
Send "+{Right}"
else
Send "{Right}"
}
sc07B & y:: ; Home
{
if GetKeyState("Shift")
Send "+{Home}"
else
Send "{Home}"
}
sc07B & u:: ; PageDown
{
if GetKeyState("Shift")
Send "+{PgDn}"
else
Send "{PgDn}"
}
sc07B & i:: ; PageUp
{
if GetKeyState("Shift")
Send "+{PgUp}"
else
Send "{PgUp}"
}
sc07B & o:: ; End
{
if GetKeyState("Shift")
Send "+{End}"
else
Send "{End}"
}
sc07B & x::
{
; Check if Shift is physically pressed
if GetKeyState("Shift")
Send "+{Delete}" ; Shift + Delete (Cut or alternative delete) - Or use {Backspace} if preferred
else
Send "{Delete}"
}
; --- For YAPA2 ---
; YAPA.exe のパスを設定
; 注意: YAPA2をアップデートするとバージョン番号が変わる可能性があります。
; その場合は、ここのパスを修正してください。
UserProfilePath := EnvGet("USERPROFILE")
exePath := UserProfilePath "\AppData\Local\YAPA2\app-2.0.190\YAPA.exe"
; --- Hotkeys ---
; YAPA2 タイマーを開始 (!F5)
!F5::
{
global exePath ; グローバル変数を参照することを明示(必須ではないが良い習慣)
If FileExist(exePath)
Run('"' exePath '" /start')
Else
MsgBox("YAPA.exe が見つかりません。パスを確認してください: " . exePath)
; return は不要
}
; YAPA2 タイマーを一時停止 (!F6)
!F6::
{
global exePath
If FileExist(exePath)
Run('"' exePath '" /pause')
Else
MsgBox("YAPA.exe が見つかりません。パスを確認してください: " . exePath)
; return は不要
}
; --- For Minecraft ---
#HotIf WinActive("ahk_class GLFW30") ; Use #HotIf with WinActive() function
; Ctrl + E -> F3
^e::Send "{F3}"
; Ctrl + 1 -> Left Mouse Button Down (Hold)
^1::Click "Left", "Down" ; Use Click() function
; Ctrl + 2 -> Hold W + Left Shift until any other key is pressed
^2::
{
Send "{w Down}"
Send "{LShift Down}"
; v2 doesn't have a direct equivalent to v1's Input T option for timeout without collecting input.
; Using InputHook as a replacement requires more setup.
; A simpler approach might be to use another key (like Ctrl+2 again) to release.
; This implementation waits for *any* key press using InputHook.
ih := InputHook("V", "{LControl}{RControl}{LAlt}{RAlt}{LShift}{RShift}{LWin}{RWin}{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{Left}{Right}{Up}{Down}{Home}{End}{PgUp}{PgDn}{Del}{Ins}{BS}{Capslock}{Numlock}{PrintScreen}{Pause}")
ih.Start()
ih.Wait() ; Wait indefinitely until a key is pressed
Send "{w Up}"
Send "{LShift Up}"
}
; Ctrl + 3 -> Start Loop Clicking (Stop with Ctrl + 0)
^3::
{
Global isStopLoop := 0 ; Declare as global if accessed by another hotkey (^0)
Loop
{
Click() ; Use Click() function
Sleep 1000 ; Use Sleep() function
if (isStopLoop = 1)
{
Break ; Exit the loop
}
}
}
; Ctrl + 4 -> Start Loop Jumping and Right Clicking (Stop with Ctrl + 0)
^4::
{
Global isStopLoop := 0 ; Declare as global
Loop
{
Send "{Space Down}"
Sleep 50
Send "{Space Up}"
Sleep 350
Click "Right" ; Use Click() function for right click
Sleep 100
if (isStopLoop = 1)
{
Break
}
}
}
; Ctrl + 0 -> Stop the loops started by Ctrl+3 or Ctrl+4
^0::
{
Global isStopLoop := 1 ; Set the flag to stop the loops
}
#HotIf ; End Minecraft specific hotkeys
; --- For LINE ---
#HotIf WinActive("ahk_class Qt5152QWindowIcon")
; Ctrl + Enter -> Alt + Enter
^Enter::Send "!{Enter}"
#HotIf ; End LINE specific hotkeys
; --- For AviUtl ---
#HotIf WinActive("ahk_class ExtendedFilterClass")
; Middle Mouse Button -> Enter
MButton::Send "{Enter}"
#HotIf ; End AviUtl Extended Filter specific hotkeys
; #HotIf WinActive("ahk_class AviUtl")
; ; Browser Back Button (XButton1) -> Delete
; XButton1::Send "{Delete}"
; ; Ctrl + Browser Back Button (XButton1) -> Delete
; ^XButton1::Send "{Delete}"
; #HotIf ; End AviUtl main window specific hotkeys
; --- Numeric Keypad Simulation (Uncommented and converted) ---
; Shift + Alt + 1 -> Numpad 1
; +!1::Send "{Numpad1}"
; +!2::Send "{Numpad2}"
; +!3::Send "{Numpad3}"
; +!4::Send "{Numpad4}"
; +!5::Send "{Numpad5}"
; +!6::Send "{Numpad6}"
; +!7::Send "{Numpad7}"
; +!8::Send "{Numpad8}"
; +!9::Send "{Numpad9}"
; +!0::Send "{Numpad0}"
; --- For Dead by Daylight ---
#HotIf WinActive("ahk_class UnrealWindow")
; Browser Back Button (XButton1) -> F9
XButton1::Send "{F9}"
#HotIf ; End Dead by Daylight specific hotkeys
; --- For Microsoft Edge (or other Chrome-based browsers) ---
#HotIf WinActive("ahk_class Chrome_WidgetWin_1")
; Disable F1 key
F1:: {
; Do nothing
}
#HotIf ; End Edge specific hotkeys
; --- For AviUtl ---
#HotIf WinActive("ahk_class AviUtl")
; Browser Back Button (XButton1) -> Delete
XButton1::Send "{Delete}"
; Ctrl + XButton1 -> Ctrl + Delete
^XButton1::Send "^{Delete}"
; Shift + XButton1 -> Shift + Delete
+XButton1::Send "+{Delete}"
; Ctrl + Shift + XButton1 -> Ctrl + Shift + Delete
^+XButton1::Send "^+{Delete}"
#HotIf ; End AviUtl main window specific hotkeys
; --- End of Script ---