Simulating a mouse right click
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Jul 15, 2003
- 454 views
Derek, I was just playing with the mouse routines. At the moment you have: global procedure clickPointerLeft() w32Proc(xmouse_event,{6,0,0,0,0}) end procedure and: global procedure dragPointerTo(sequence pos) w32Proc(xmouse_event,{#2,0,0,0,0}) w32Proc(xSetCursorPos,{pos[1],pos[2]}) w32Proc(xmouse_event,{#4,0,0,0,0}) end procedure I suggest adding the constants: MOUSEEVENTF_LEFTDOWN =3D #0002, MOUSEEVENTF_LEFTUP =3D #0004, MOUSEEVENTF_RIGHTDOWN =3D #0008, MOUSEEVENTF_RIGHTUP =3D #0010, MOUSEEVENTF_MIDDLEDOWN =3D #0020, MOUSEEVENTF_MIDDLEUP =3D #0040, (and possibly, but I'm not sure:) MOUSEEVENTF_MOVE =3D #0001, MOUSEEVENTF_WHEEL =3D #0800, MOUSEEVENTF_ABSOLUTE =3D #8000, and also adding a more general purpose routine: global procedure clickPointer(object dwFlags) if sequence(dwFlags) then dwFlags=3Dor_all(dwFlags) end if w32Proc(xmouse_event,{dwFlags,0,0,0,0}) end procedure One catch is the msdn page states mouse_event has been superceded by SendInput. What do you think? Pete