AutoHotInterception/SubscribeAll Example.ahk

23 lines
522 B
AutoHotkey
Raw Normal View History

2019-11-14 19:11:09 +00:00
#SingleInstance force
#Persistent
#include Lib\AutoHotInterception.ahk
AHI := new AutoHotInterception()
keyboardId := AHI.GetKeyboardId(0x04F2, 0x0112)
AHI.SubscribeKeyboard(keyboardId, true, Func("KeyEvent"))
2019-11-14 19:46:23 +00:00
mouseId := AHI.GetMouseId(0x046D, 0xC00C)
AHI.SubscribeMouseButtons(mouseId, true, Func("MouseButtonEvent"))
2019-11-14 19:11:09 +00:00
return
KeyEvent(code, state){
2019-11-14 19:46:23 +00:00
ToolTip % "Keyboard Key - Code: " code ", State: " state
}
MouseButtonEvent(code, state){
ToolTip % "Mouse Button - Code: " code ", State: " state
2019-11-14 19:11:09 +00:00
}
^Esc::
ExitApp