Page 1 of 1

addScript-#If Problem

Posted: 03 Feb 2018, 09:03
by arcticir
The hot keys of my mouse gestures seem to have failed:

Code: Select all

#If choose(keys.L,1)
{
*LButton:: Down("L")
}
#If choose(keys.L,0)
{
*LButton up:: up("L") 
}
#If choose(keys.r,1)
{
*Rbutton:: Down("r")
}
#If choose(keys.r,0)
{
*Rbutton up:: up("r") 
}

Only "Lbutton" triggers the "choose" function. and returns the result of the error.
other hotkey is not responding.

I don't know what the "update" brings to the change, so I don't know how to modify it to make it normal. :shock:

Re: addScript-#If Problem

Posted: 03 Feb 2018, 14:40
by HotKeyIt
Can you give me a full example.

Re: addScript-#If Problem

Posted: 13 Feb 2018, 10:03
by arcticir
Sorry, I have a very serious delay.

Code: Select all

f:=ahkdll()
f.new("#Persistent`nCriticalObject(" (&f) ").add(FileRead(`"1.ahk`"))`nreturn ")
MsgBox "Test"
ahkdll(r:=""){
	static dll
	if !dll
	UnZipRawMemory(LockResource(LoadResource(0,hRes:=FindResource(0,"F903E44B8A904483A1732BA84EA6191F",10))),SizeofResource(0,hRes),dll)
	return CriticalObject({"":r:=MemoryLoadLibrary(&dll)
		,"func":DynaCall(MemoryGetProcAddress(r,"ahkFunction"),"s==sssssssssss")
		,"post":DynaCall(MemoryGetProcAddress(r,"ahkPostFunction"),"i==sssssssssss")
		,"new":DynaCall(MemoryGetProcAddress(r,"ahktextdll"),"ut==sss")
		,"add":DynaCall(MemoryGetProcAddress(r,"addScript"),"ut==si")
		,"exec":DynaCall(MemoryGetProcAddress(r,"ahkExec"),"ut==sui")
		,"get":DynaCall(MemoryGetProcAddress(r,"ahkgetvar"),"s==sui")
		,"set":DynaCall(MemoryGetProcAddress(r,"ahkassign"),"ui==ss")
		,"sub":DynaCall(MemoryGetProcAddress(r,"ahkLabel"),"ui==sui")
		,"pause":DynaCall(MemoryGetProcAddress(r,"ahkPause"),"i==s")
		,"exit":DynaCall(MemoryGetProcAddress(r,"ahkTerminate"),"i==i")
		,"ready":DynaCall(MemoryGetProcAddress(r,"ahkReady"),"")
		,"reload":DynaCall(MemoryGetProcAddress(r,"ahkReload"),"i==i")})
}

1.ahk

Code: Select all

#If choose("L",1)
{
*LButton:: Down("L")
}
#If choose("L",0)
{
*LButton up:: up("L") 
}
#If choose("r",1)
{
*Rbutton:: Down("r")
}
#If choose("r",0)
{
*Rbutton up:: up("r") 
}
up(a){

}
down(a){

}
choose(s,a){
ToolTip s
}

Re: addScript-#If Problem

Posted: 17 Feb 2018, 09:48
by HotKeyIt
This should be fixed, let me know if it works now!

Re: addScript-#If Problem

Posted: 25 Feb 2018, 23:50
by arcticir
Thanks, it's normal now.