aboutsummaryrefslogtreecommitdiff
path: root/scripts.ahk
blob: 301a46a7fc9e29cf72a270212789350833dc9ffb (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
#Include ../lib/Acc.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>>

LWin Up::Send {RCtrl}

; 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

#e::Run, % "explorer /n, ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" ; open my computer

; 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)
	}
}