mirror of
https://github.com/evilC/AutoHotInterception.git
synced 2024-11-10 19:10:46 +00:00
42 lines
841 B
AutoHotkey
42 lines
841 B
AutoHotkey
#SingleInstance force
|
|
#Persistent
|
|
#include Lib\AutoHotInterception.ahk
|
|
|
|
VID := 0x04F2, PID := 0x0112
|
|
|
|
InterceptionWrapper := new AutoHotInterception()
|
|
global Interception := InterceptionWrapper.GetInstance()
|
|
|
|
devices := InterceptionWrapper.GetDeviceList()
|
|
if (!devices.Length()){
|
|
msgbox Device List Check failed
|
|
ExitApp
|
|
}
|
|
|
|
keyboardId := Interception.GetDeviceId(false, VID, PID)
|
|
|
|
result := Interception.SetContextCallback(keyboardId, Func("SetKb1Context"))
|
|
if (result != -1){
|
|
msgbox Subscribe failed
|
|
ExitApp
|
|
}
|
|
return
|
|
|
|
SetKb1Context(state){
|
|
global isKeyboard1Active
|
|
Sleep 0 ; We seem to need this for hotstrings to work, not sure why
|
|
isKeyboard1Active := state
|
|
}
|
|
#if isKeyboard1Active
|
|
::aaa::JACKPOT
|
|
1::
|
|
ToolTip % "KEY DOWN EVENT @ " A_TickCount
|
|
return
|
|
|
|
1 up::
|
|
ToolTip % "KEY UP EVENT @ " A_TickCount
|
|
return
|
|
#if
|
|
|
|
^Esc::
|
|
ExitApp |