You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AutoHotInterception/Lib/AutoHotInterception.ahk

38 lines
913 B
Plaintext

#include %A_LineFile%\..\CLR.ahk
6 years ago
class AutoHotInterception {
__New(cls := "Manager"){
dllName := "AutoHotInterception.dll"
dllFile := A_LineFile "\..\" dllName
6 years ago
if (!FileExist(dllFile)){
MsgBox % "Unable to find " dllFile ", exiting..."
ExitApp
}
asm := CLR_LoadLibrary(dllFile)
try {
this.Interception := asm.CreateInstance("AutoHotInterception." cls)
}
catch {
MsgBox % dllName " failed to load"
6 years ago
ExitApp
}
if (this.Interception.OkCheck() != "OK"){
MsgBox % dllName " loaded but check failed!`nTry right-clicking lib\" dllName ", select Properties, and if there is an 'Unblock' checkbox, tick it"
6 years ago
ExitApp
}
}
6 years ago
GetInstance(){
return this.Interception
}
6 years ago
GetDeviceList(){
DeviceList := {}
arr := this.Interception.GetDeviceList()
for v in arr {
DeviceList[v.id] := { ID: v.id, VID: v.vid, PID: v.pid, IsMouse: v.IsMouse }
}
return DeviceList
}
}