This should work:
Rem ---------------------------------------------
Rem FORCE INPUT - constants
Rem ---------------------------------------------
#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)
Rem ---------------------------------------------
Rem FORCE INPUT - init
Rem ---------------------------------------------
Function init_forceInput()
Global PTR_MOUSE_POS as Integer : PTR_MOUSE_POS = alloc(8)
load dll "user32.dll", User32
endFunction
Rem ---------------------------------------------
Rem FORCE INPUT - mouse
Rem ---------------------------------------------
function SetMousePosition(x,y)
CALL DLL User32,"SetCursorPos",x,y
endFunction
function GetMouseX()
null = call dll(User32, "GetCursorPos", PTR_MOUSE_POS)
x = peek integer(PTR_MOUSE_POS)
endFunction x
function GetMouseY()
null = call dll(User32, "GetCursorPos", PTR_MOUSE_POS)
y = peek integer(PTR_MOUSE_POS + 4)
endFunction y
Function ForceMouseClick(click)
if click = 0 then Mouse_Event( 2)
if click = 1 then Mouse_Event( 12)
if click = 2 then Mouse_Event( 34)
if click = 3 then Mouse_Event(1234)
if click = 4 then Mouse_Event( 56)
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
