So I'm trying to invert how the mouse works, pretty much.
If I hold down RButton, I wamt to do a full click, but if I click once, I want to hold RButton down until I click RButton again.
This are some of the tests I've done so far and the last one is the one that was worked the best so far, problem is... it still sends RButton twice after I release it
First Attempt
Code: Select all
RButton up::
{
toggle:=!toggle
if (toggle)
{
Send {RButton down}
}
else
{
Send {RButton up}
}
return
}
RButton::
{
Sleep 100
While GetKeyState("RButton", "P")
{
tooltip RButton Toggle
Send {RButton down}
Sleep 50
Send {RButton up}
}
return
}
Second Attempt
Code: Select all
RButton::
Duration=0
Loop
{
Duration ++
If (Duration > 100)
{
Send {RButton down}
Sleep 50
Send {RButton up}
}
If (Duration < 100)
{
toggle:=!toggle
if (toggle)
{
Send {RButton down}
}
else
{
Send {RButton up}
}
}
If !GetKeyState("RButton","P")
{
return
}
}
Maybe there is some software that does this? I haven't found one yet, but would rather have it on AHK.
Thanks for any help / tips!
Edit1:
I've somehow made it work partly, sometimes it doesn't click, might be me though
Code: Select all
$RButton::
{
KeyWait, RButton, T0.099
If (Errorlevel=0)
{
toggle:=!toggle
if (toggle)
{
Send {RButton down}
}
else
{
Send {RButton up}
}
return
}
If (Errorlevel=1)
{
Send {RButton down}
Sleep 50
Send {RButton up}
return
}
return
}