Hello,
It's possible with AHK to have two functions with the same key ?
Example:
Key = E
When I click on this Key = E
When I HOLD the Key = F (until I release the key).
?
Thanks
One Key for Two Functions (Click and Hold). Topic is solved
-
- Posts: 9
- Joined: 12 Jan 2017, 23:36
Re: One Key for Two Functions (Click and Hold).
Code: Select all
$E::
KeyWait, E, T0.2 ; 200 ms
If (!ErrorLevel)
Send, E
else
{
Send, F
KeyWait, E
}
return
-
- Posts: 9
- Joined: 12 Jan 2017, 23:36
Re: One Key for Two Functions (Click and Hold).
Nice, but not work properly.
When I hold the Key, it type only one time "F" and stop after that. I want it hold "F" while i Hold the Key E. In notepad for example, it should write "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF....." until I release the key E.
It's possible ?
Thanks
When I hold the Key, it type only one time "F" and stop after that. I want it hold "F" while i Hold the Key E. In notepad for example, it should write "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF....." until I release the key E.
It's possible ?
Thanks
Re: One Key for Two Functions (Click and Hold). Topic is solved
Code: Select all
$E::
KeyWait, E, T0.2 ; 200 ms
If (!ErrorLevel)
Send, E
else {
while getkeystate("e", "p") {
SendInput, F
sleep 50
}
}
return
-
- Posts: 9
- Joined: 12 Jan 2017, 23:36
Re: One Key for Two Functions (Click and Hold).
Edit:Xeno234 wrote:Code: Select all
$E:: KeyWait, E, T0.2 ; 200 ms If (!ErrorLevel) Send, E else { while getkeystate("e", "p") { SendInput, F sleep 50 } } return
It finally works as I expected.
When I tried this for the first time, I do a mistake with it, but now, It works very well.
Thanks
Who is online
Users browsing this forum: JPMuir and 331 guests