Rapid-Q by William Yu (c)1999-2000 .

Back to holyguard.net

Bottoni del mouse

''Mouse buttons detection

''result of getasynckeystate 1=left,2=right,0 = allup



Declare Function GetAsyncKeyState Lib "user32" Alias _

"GetAsyncKeyState" (vKey As Long) As Integer

declare sub scanmouse

dim scan as Qtimer

scan.ontimer=scanmouse

scan.interval=100



CREATE Form AS QFORM

                create s as qedit

                               text="Drag me!"

                end create

END CREATE

Form.ShowModal



sub scanmouse

                dim oldx as short,oldy as short

                dim oldleft as short,oldtop as short

                if getasynckeystate(1)<>0 then

                               screen.cursor=-12

                               oldx=screen.mousex:oldy=screen.mousey

                               oldleft=s.left:oldtop=s.top

                               while getasynckeystate(1)<>0

                                               s.left=oldleft+screen.mousex-oldx

                                               s.top=oldtop+screen.mousey-oldy

                               wend

                               screen.cursor=0

                end if

end sub