From 1f460f7ebc10c2f8bb66ae684498f49187eab9bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Fri, 23 Oct 2020 01:44:02 +0200 Subject: first commit --- scripts.ahk | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 scripts.ahk (limited to 'scripts.ahk') 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 ------------------------------------------------------------------ + +<> + +#SingleInstance Force +#Persistent +#NoEnv +#WinActivateForce +#MaxHotkeysPerInterval 200 + +; Initialization -------------------------------------------------------------- + +WindowMessageHandlers := [] + +<> + +Gui +LastFound +DllCall("RegisterShellHookWindow", UInt, WinExist()) +msg := DllCall("RegisterWindowMessage", Str, "SHELLHOOK") +OnMessage(msg, "WindowMessage") +return + +; 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 --------------------------------------------------------------------- + +<> + +WindowMessage(wParam, lParam) +{ + global WindowMessageHandlers + for k, v in WindowMessageHandlers + { + %v%(wParam, lParam) + } +} -- cgit v1.2.3