[Help] Mouse button
ok i want to create a loop that when a button or hotkey is pressed it will...
when you press and hold the mouse button instead of single clicking it will send the button ever x amount of secs
example.. in autohotkey i have a rapid fire script that looks like this
[PHP]Ins::Suspend
LButton::
Loop
{
SetMouseDelay 15
Click
If (GetKeyState("LButton","P")=0)
Break
}
[/PHP]
which is what im looking to put into a loop i know it in ahk but not in vb any idea what i need to do
what do you mean exactly? Do you want it to continually click for a certain amount of seconds or what? Sorry I didn't understand you properly.
sorry kind of hard to explain ok in the script i have when you use say the fal in mw2 and you click and hold the fire button it make the fal full auto by sending the fire button repeatedly and i want to code that in vb not sure how
that help any?
p.s. congratz on 1337
[php]private sub RapidFire(Byval sleeptime as integer)
Do while getasynckeystate(LButtonDown) ' = True
mouse_event(LButtonDown, 0, 0, 0, 0)
mouse_event(LbuttonUp, 0, 0, 0, 0)
threading.thread.sleep(sleeptime)
loop
end sub[/php]
[php]RapidFire(15)[/php]
This will click the left mousebutton and wait 15 miliseconds.
Should work =/
do i use this with nextgens keyboard hook?
No. You only need the following:
[php] Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Int32) As Int16
Private Declare Sub mouse_event Lib "user32" (ByVal dwflags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cbuttons As Long, ByVal dwExtraInfo As Long)
Private Const LButtonDown = &H2
Private Const LButtonUp = &H4
[/php]