Please note that the Constants are the Commands, as a result, this would make a great #Include Files as it gives about 10 new mouse commands
` -----------------------------------------------------------------
` By Michael Mihalyfi, (MSon)
` Mihalyfi@hotmail.co.uk
` -----------------------------------------------------------------
` Setup -----------------------------------------------------------
#Constant User32 1
#Constant MOUSE_LEFTDOWN Mouse_Event( 1)
#Constant MOUSE_LEFTUP Mouse_Event( 2)
#Constant MOUSE_LEFTCLICK Mouse_Event( 12)
#Constant MOUSE_DOUBLECLICK Mouse_Event(1212)
#Constant MOUSE_RIGHTDOWN Mouse_Event( 3)
#Constant MOUSE_RIGHTUP Mouse_Event( 4)
#Constant MOUSE_RIGHTCLICK Mouse_Event( 34)
#Constant MOUSE_MIDDLEDOWN Mouse_Event( 5)
#Constant MOUSE_MIDDLEUP Mouse_Event( 6)
#Constant MOUSE_MIDDLECLICK Mouse_Event( 56)
load dll "user32.dll",User32
` -----------------------------------------------------------------
MOUSE_LEFTCLICK
END
` --------------------------------------------------------------------------------
FUNCTION SetCursorPos(x,y)
CALL DLL 1,"SetCursorPos",x,y
ENDFUNCTION
` ----------------------------------------------------------
FUNCTION Mouse_Event(Btn)
FOR n = 1 to LEN(STR$(Btn)) : v = Val(Mid$(STR$(Btn),n))
IF v = 1 THEN CALL DLL User32,"mouse_event",0x2 ,0,0,0,0
IF v = 2 THEN CALL DLL User32,"mouse_event",0x4 ,0,0,0,0
IF v = 3 THEN CALL DLL User32,"mouse_event",0x8 ,0,0,0,0
IF v = 4 THEN CALL DLL User32,"mouse_event",0x10,0,0,0,0
IF v = 5 THEN CALL DLL User32,"mouse_event",0x20,0,0,0,0
IF v = 6 THEN CALL DLL User32,"mouse_event",0x40,0,0,0,0
NEXT n
ENDFUNCTION
` ----------------------------------------------------------
I origionally posted this in code snippets, but someone deleted it as i didn't include [DBP] in the title
This is very simple to use, for example you can simulate a left mouseclick like this
Or like this
MOUSE_LEFTDOWN
MOUSE_LEFTUP
The second version, If you delay the MOUSE_LEFTUP, then it should force a click and drag situation, but i've not tested this.
This souce also includes commands for Middle + Right Click and Double Click, but by calling MOUSE_EVENT(Btns), you can also simulate Combos, Double Right Click, Whatever you want
I was messing arround with this last night to link it to a JoyPad
Everyone Be Cool, You, Be Cool.