How to check to see if I am holding down the right mouse button?
Posted: 07 Apr 2024, 02:27
Hi,
Does anyone know how to draft a script that will:
Check if I click and hold down the right mouse button for more than 3 seconds
If I do I would like the script to hold down the right mouse button for me even if I release the mouse button
until I click the right mouse button again then it can 'lift' the right mouse button
Here is a piece of code I was working with but it aint quite there.
If I use the same mouse button as the toggle it gets confused so I tried playing with using the rbutton to toggle the lbutton but idealy I would like it to just all be on the one.
Also not sure how to toggle it only after I hold down the mouse button.
Thanks in advance!
[Mod edit: Added [code][/code] tags/replaced blue color tags around the code - which is almost unreadable in dark forum themes, btw. Please use code tags yourself when posting code!]
Does anyone know how to draft a script that will:
Check if I click and hold down the right mouse button for more than 3 seconds
If I do I would like the script to hold down the right mouse button for me even if I release the mouse button
until I click the right mouse button again then it can 'lift' the right mouse button
Here is a piece of code I was working with but it aint quite there.
If I use the same mouse button as the toggle it gets confused so I tried playing with using the rbutton to toggle the lbutton but idealy I would like it to just all be on the one.
Also not sure how to toggle it only after I hold down the mouse button.
Thanks in advance!
Code: Select all
#RButton::
8::
If (toggle := !toggle) {
Send {LButton Down}
SoundBeep, 250, 20
} Else {
Send {LButton Up}
SoundBeep, 500, 20
}
Return
PAUSE::ExitApp