Skip to content

Instantly share code, notes, and snippets.

View A-AhkUser's full-sized avatar

Jérémy Duthois A-AhkUser

  • L'Isle d'Espagnac (France)
View GitHub Profile
@A-AhkUser
A-AhkUser / WinEventHook.ahk
Last active October 3, 2020 22:58
Namespace: WinEventHook
; Usage example:
/*
#NoEnv
#SingleInstance force
#Warn
#Persistent
ControlGet, hEdit1, Hwnd,, Edit1, ahk_class Notepad
if not (hEdit1)
ExitApp
#NoEnv
#SingleInstance force
#Warn
Menu, Tray, Tip, % A_AhkVersion
for direction, params in ({"Left": [ "x", -1 ], "Up": [ "y", -1 ], "Right": [ "x", 1 ], "Down": [ "y", 1 ]})
{
fn1 := Func("f").bind(params[1] . "1", params[2]), fn2 := Func("f").bind(params[1] . "2", params[2])
Hotkey % "#Numpad" . direction, % fn1, On