/
script-hotkeys.ahk
65 lines (54 loc) · 1.28 KB
/
script-hotkeys.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
#Include <default-settings>
#Include <functions>
;= =============================================================================
;= Globals
;= =============================================================================
G_WillReload := false
;= =============================================================================
;= Script hotkeys
;= =============================================================================
#SuspendExempt
/**
* Suspend.
*/
#^s:: {
Suspend()
DetectHiddenWindows(true)
if WinExist('ahk_exe brightness-setter.exe') {
SendMessage(K_WIN32_CONSTS['WM_COMMAND'], K_CONTROL_CODES['TRAY']['SUSPEND'])
}
}
#SuspendExempt false
/**
* Reload.
*/
#^r:: {
global G_WillReload := true
Run('meta-launcher.ahk')
}
#^p:: Pause(-1)
#^x:: ExitApp()
/**
* Edit.
*/
#^e:: {
loop files '*.code-workspace' {
Run(A_LoopFileName)
}
}
#^h:: Run('https://www.autohotkey.com/docs/v2/')
#^w:: WinSpy()
WinSpy() {
static WIN_SPY := 'Window Spy ahk_class AutoHotkeyGUI'
try {
minMax := WinGetMinMax(WIN_SPY)
} catch {
Run('WindowSpy.ahk', A_ProgramFiles '\AutoHotkey')
} else if minMax = -1 {
WinExist('A')
WinActivate(WIN_SPY)
WinActivate()
} else {
WinClose(WIN_SPY)
}
}