aboutsummaryrefslogtreecommitdiff
path: root/scripts.ahk
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2020-10-23 01:44:02 +0200
committerJohn Ankarström <john@ankarstrom.se>2020-10-23 01:44:02 +0200
commit1f460f7ebc10c2f8bb66ae684498f49187eab9bc (patch)
tree776f7a92b0d24e27cd682e4ff76bde477a02ff98 /scripts.ahk
downloadahk-1f460f7ebc10c2f8bb66ae684498f49187eab9bc.tar.gz
first commit
Diffstat (limited to 'scripts.ahk')
-rw-r--r--scripts.ahk62
1 files changed, 62 insertions, 0 deletions
diff --git a/scripts.ahk b/scripts.ahk
new file mode 100644
index 0000000..de1fd0b
--- /dev/null
+++ b/scripts.ahk
@@ -0,0 +1,62 @@
+#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>>
+
+; Miscellaneous
+
+#Space::CapsLock
+#PrintScreen::Media_Prev
+#ScrollLock::Media_Play_Pause
+#Pause::Media_Next
+
+#e::Run, % "explorer /n, ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
+#!t::WinSet, AlwaysOnTop,, ahk_class tooltips_class32 ; fix bug
+
+; 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
+
+; Library ---------------------------------------------------------------------
+
+<<library>>
+
+WindowMessage(wParam, lParam)
+{
+ global WindowMessageHandlers
+ for k, v in WindowMessageHandlers
+ {
+ %v%(wParam, lParam)
+ }
+}