AutoHotInterception icon indicating copy to clipboard operation
AutoHotInterception copied to clipboard

Hello evilC,How to change the below context script to subscription script?

Open PotatoJet opened this issue 6 years ago • 4 comments

I'm sorry to bother you again. How to change the below context script to subscription script? (Only subscription,not combined.Thanks)

#SingleInstance force
#Persistent
#include C:\AutoHotInterception\Lib\AutoHotInterception.ahk

AHI := new AutoHotInterception()
id1 := AHI.GetKeyboardId(0x1C4F, 0x0002, 1)  
cm1 := AHI.CreateContextManager(id1)

id2 := AHI.GetKeyboardId(0x258A,0x001F, 1)   
cm2 := AHI.CreateContextManager(id2)
return

#if cm1.IsActive

z::
send A
return

#if


#if cm2.IsActive

z::
send O
return

#if

PotatoJet avatar Dec 19 '19 13:12 PotatoJet

@evilC Merry Christmas!

PotatoJet avatar Dec 24 '19 07:12 PotatoJet

#SingleInstance force
#include Lib\AutoHotInterception.ahk

AHI := new AutoHotInterception()
id1 := AHI.GetKeyboardId(0x1C4F, 0x0002, 1)  
id2 := AHI.GetKeyboardId(0x258A, 0x001F, 1)   

AHI.SubscribeKey(id1, GetKeySC("z"), true, Func("Kb1Event"))
AHI.SubscribeKey(id2, GetKeySC("z"), true, Func("Kb2Event"))
return

Kb1Event(state){
	if (state){
		Send A
	}
}

Kb2Event(state){
	if (state){
		Send O
	}
}

evilC avatar Dec 24 '19 11:12 evilC

#SingleInstance force
#include Lib\AutoHotInterception.ahk

AHI := new AutoHotInterception()
id1 := AHI.GetKeyboardId(0x1C4F, 0x0002, 1)  
id2 := AHI.GetKeyboardId(0x258A, 0x001F, 1)   

AHI.SubscribeKey(id1, GetKeySC("z"), true, Func("Kb1Event"))
AHI.SubscribeKey(id2, GetKeySC("z"), true, Func("Kb2Event"))
return

Kb1Event(state){
	if (state){
		Send A
	}
}

Kb2Event(state){
	if (state){
		Send O
	}
}

Thanks again. You are a real gentleman.

PotatoJet avatar Dec 24 '19 12:12 PotatoJet

666

Thank you for your help,evilC. How to replace the Highlights (state){ if (state){ to :: ,and } } to return ? Because I prefer AHK's normal script. Thanks.

PotatoJet avatar Jul 20 '20 06:07 PotatoJet