aboutsummaryrefslogtreecommitdiff
path: root/scripts.ahk
blob: 1cde37d33cb5a0d1410daeed1efb8468956967cf (plain)
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
#Include ../lib/Acc.ahk
#Include ../lib/Misc.ahk

; Directives ------------------------------------------------------------------

<<directives>>

#SingleInstance Force
#Persistent
#NoEnv
#WinActivateForce
#MaxHotkeysPerInterval 200

; Initialization --------------------------------------------------------------

WindowMessageHandlers := []

<<init>>

Gui +LastFound
DllCall("RegisterShellHookWindow", UInt, WinExist())
msg := DllCall("RegisterWindowMessage", Str, "SHELLHOOK")
OnMessage(msg, "WindowMessage")
return

; Body ------------------------------------------------------------------------

<<body>>

; Zoom toggle mute

#If !GetKeyState("NumLock", "T")
F1::ControlSend, ZPControlPanelClass1, {Alt down}a{Alt up}, ahk_class ZPContentViewWndClass
#If

; Caps Lock toggle/display

#Space::
SetCapsLockState % !GetKeyState("CapsLock", "T")
/*
CoordMode, ToolTip, Screen
if (GetKeyState("CapsLock", "T"))
	ToolTip, Caps Lock, 8, % A_ScreenHeight - 70
else
	ToolTip
CoordMode, ToolTip
*/
return

; Miscellaneous

#PrintScreen::Media_Prev
#ScrollLock::Media_Play_Pause
#Pause::Media_Next

#If !DisableHotkeys
#d::
if (not WinActive("ahk_group Desktop")) ; see tt.programs.explorer.ahk
{
	SendInput, #m
	WinActivate, ahk_group Desktop
}
return
#+d::#+m
#If

*~^PrintScreen::
Run, "C:\Program Files\ImageMagick\magick.exe" clipboard: scr.jpg, % env("TEMP"), Hide
Sleep, 200
ClipboardSetFiles(env("TEMP") "\scr.jpg")
return

; Enable/disable proxy server

#^p::Run, toggleproxy 1,, Hide
#!p::Run, toggleproxy 0,, Hide

; Sleep

<^>!+F12 Up::
Sleep, 600
DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)
return

<^>!^F12 Up::
Sleep, 600
SendMessage,0x112,0xF170,2,,Program Manager ; turn off monitor
return

<^>!F12 Up::
Sleep, 600
Run, %A_WinDir%\system32\Mystify.scr /s ; start screen saver
return

; Library ---------------------------------------------------------------------

<<library>>

WindowMessage(wParam, lParam)
{
	global WindowMessageHandlers
	for k, v in WindowMessageHandlers
	{
		%v%(wParam, lParam)
	}
}