Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
PotatoJet opened this issue Dec 19, 2019 · 4 comments

Comments

@PotatoJet
Copy link

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
Copy link
Author

@evilC Merry Christmas!

@evilC
Copy link
Owner

evilC commented Dec 24, 2019

#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
	}
}

@PotatoJet
Copy link
Author

#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 PotatoJet reopened this Jan 6, 2020
@PotatoJet PotatoJet reopened this Jul 20, 2020
@PotatoJet
Copy link
Author

PotatoJet commented Jul 20, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants