Hi all
I got a difficult script to make and not sure where to start
ill try explain it...
I want the button A to be 2 keys when i click it once it makes E and when i hold it it holds down C but does not repeat C just holds it down till i release key... is this even possible my brains hurting.
and i want it to work with this...
e::
If e:=!e
{
Send {q down}
Sleep 100
Send {w down}
}
Else
Send {q up}{w up}
return
Thanks to anyone who can help.
Difficult script maybe?
Re: Difficult script maybe?
Hallo,
this??:
this??:
Code: Select all
a:: ;want the button A
Send, e{c Down} ;makes E and holds down C
KeyWait, a ;till i release key A
Send, {c up}
Return
$e:: ;and i want it to work with this
If e:=!e
{
Send {q down}
Sleep 100
Send {w down}
}
Else
Send {q up}{w up}
return
Re: Difficult script maybe?
Not sure but I tried. The problem is that clicking A once will take 200milliseconds until e is sent. That's all. I don't know a better way.
Rohwedder's script serves the same purpose but in his script E is sent regardless of whether or not you pressed or clicked A. I thought you wanted to be particular on that as e has been assigned as a hotkey. If you are not then you must add a $ prefix to the e hotkey to prevent it from being triggered every time you press A.
My script if for when you want to Click A for E and hold A for holding C. esc closes script.
Change sleep's value to a bit higher if you don't want it to trigger so early.
Rohwedder's script serves the same purpose but in his script E is sent regardless of whether or not you pressed or clicked A. I thought you wanted to be particular on that as e has been assigned as a hotkey. If you are not then you must add a $ prefix to the e hotkey to prevent it from being triggered every time you press A.
My script if for when you want to Click A for E and hold A for holding C. esc closes script.
Code: Select all
A::
Sleep 200
While GetKeyState("a","P") {
Send, {c down}
}
Send, {c up}
Send, {e}
return
e::
If e:=!e
{
Send {q down}
Sleep 100
Send {w down}
}
Else
Send {q up}{w up}
return
esc:: ExitApp
Last edited by Nwb on 17 Mar 2018, 22:31, edited 1 time in total.
I am your average ahk newbie. Just.. a tat more cute.
Re: Difficult script maybe?
Nwb wrote:Not sure but I tried. The problem is that clicking A once will take 200milliseconds until e is sent. That's all. I don't know a better way.
Rohwedder's script serves the same purpose but in his script E is sent regardless of whether or not you pressed or clicked A. I thought you wanted to be particular on that as e has been assigned as a hotkey. If you are not then you must add a tilde (~) to the e hotkey to prevent it from being triggered every time you press A.
My script if for when you want to Click A for E and hold A for holding C. esc closes script.Change sleep's value to a bit higher if you don't want it to trigger so early.Code: Select all
A:: Sleep 200 While GetKeyState("a","P") { Send, {c down} } Send, {c up} Send, {e} return e:: If e:=!e { Send {q down} Sleep 100 Send {w down} } Else Send {q up}{w up} return esc:: ExitApp
Absolutlely perfect, very clever to get your head round what i wrote but you did it, thanks very much my friend.
Re: Difficult script maybe?
One more thing would be great could you make it with this script..Nwb wrote:Not sure but I tried. The problem is that clicking A once will take 200milliseconds until e is sent. That's all. I don't know a better way.
Rohwedder's script serves the same purpose but in his script E is sent regardless of whether or not you pressed or clicked A. I thought you wanted to be particular on that as e has been assigned as a hotkey. If you are not then you must add a tilde (~) to the e hotkey to prevent it from being triggered every time you press A.
My script if for when you want to Click A for E and hold A for holding C. esc closes script.Change sleep's value to a bit higher if you don't want it to trigger so early.Code: Select all
A:: Sleep 200 While GetKeyState("a","P") { Send, {c down} } Send, {c up} Send, {e} return e:: If e:=!e { Send {q down} Sleep 100 Send {w down} } Else Send {q up}{w up} return esc:: ExitApp
e::
Send {q down}
Sleep 100
Send {w down}
KeyWait, e
Send {q up}{w up}
return
so its sort of the other way round e would now need to be held while c would be the key to click and toggle on?
Thanks again my friend trying to get my head round it is hard =)
Who is online
Users browsing this forum: No registered users and 145 guests