Is there a way to simulate and left click and hold?
4 replies, posted
i was wondering if there is a way to press in the mouse scroll wheel and have it simulate a left mouse click until i press it again ? thanks
Best bet would be in your mouse driver settings.
Quick 'n dirty AutoIt script:[CODE]#include <Misc.au3>
Dim $mousedown
While 1
Sleep(100)
If _IsPressed(4) Then
Do
Sleep(10)
Until Not _IsPressed(4)
$mousedown = Not $mousedown
If $mousedown Then
MouseDown("left")
Else
MouseUp("left")
EndIf
EndIf
WEnd[/CODE]Or, AutoHotkey:[CODE]mousedown = 0
#MButton::
mousedoen := NOT mousedown
If mousedown = 1
Click down left
else
Click up left[/CODE]
or c++
[code]
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
bool work = false;
while(true)
{
if(GetAsyncKeyState(VK_MBUTTON) & 0x8000){
work = !work
if(work)
mouse_event(MOUSEEVENTF_LEFTDOWN,x,y,0,0);
else
mouse_event(MOUSEEVENTF_LEFTUP,x,y,0,0);
}
Sleep(50)
}
}
[/code]
[QUOTE=flamingo57;35154248]i was wondering if there is a way to press in the mouse scroll wheel and have it simulate a left mouse click until i press it again ? thanks[/QUOTE]
Yes, use MouseKeys, you use 0/ins and ./del to press, one to press, and one to unpress
Sorry, you need to Log In to post a reply to this thread.