AutoHotInterception (AHI): SubscribeMouseButton event colliding with ObjBindMethod

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
a_newbie_coder
Posts: 1
Joined: 29 Jul 2021, 23:49

AutoHotInterception (AHI): SubscribeMouseButton event colliding with ObjBindMethod

Post by a_newbie_coder » 30 Jul 2021, 00:07

Hi evilC

I need your help in my script.
There seems to be a problem where either SubscribeMouseButton or ObjBindMethod is only going to work.

Code: Select all

#NoEnv
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#KeyHistory 0
ListLines Off
Process, Priority, , R
SetBatchLines, -1
SetKeyDelay, -1, -1, -1
SetMouseDelay, -1
SetControlDelay, -1
SetDefaultMouseSpeed, 0
SendMode Input
SetWorkingDir %A_ScriptDir% 


#Persistent
#include C:\Users\Lenovo\Documents\AutoHotKey\Lib\AutoHotInterception.ahk

AHI := new AutoHotInterception()

mouseId := AHI.GetMouseId(0x25A7, 0xFA23)

AHI.SubscribeMouseButton(mouseId, 5, true, Func("WheelEvent"))
return

WheelEvent(){

{
 Click right down
 sleep 8
 Click right up
}


CPS := []

SetTimer showCPS, 10
showCPS:
        if (Cps.Count() > 3) {
        DllCall("Sleep", "UInt", 10)
        Click down
        DllCall("Sleep", "UInt", 10)
        Click up
}
return

~*LButton Up::
	CPS.Push(A_TickCount)
	fn := ObjBindMethod(CPS, "Pop")
	SetTimer % fn, -400
return
This returns with an error and I have no clue to fix it.
I'm sorry if the mistake I made was extremely obvious because I'm a begginer on this.

Return to “Ask for Help (v1)”