|
Post by alwichita2 on Feb 13, 2023 18:29:41 GMT -5
Hi Guys,
I have a sample program (below) to check for left mouse button clicks.
What I would like to do is...
If there are no mouse clicks in say 3 minutes, I'd like to branch to a 'branch label' or subroutine.
Since the event handler 'waits' for a mouse click how does it do anything else ?
Thanks Al
''''''''''''''''''''''''''''''''''''''''''''''''''''
nomainwin
WindowHeight = 800 : WindowWidth = 1280
UpperLeftX = 0
UpperLeftY = 0
graphicbox #w.g, 0, 0, 1280, 800
open "bs" for window_popup as #w
''''''''''''''''''''''''''''''''''''
#w.g, "backcolor black"
#w.g, "drawsprites"
#w.g, "font eurostile 20 bold"
#w.g, "Color lightgray"
prx=50 : pry=50
print #w.g, "goto ";prx;" ";pry
print #w.g, "\\ ";"Click anywhere to get Mouse Coordinates, bottom right corner to [EXIT] "
''''''''''''''''''''''''''''''''''''' #w.g, "font eurostile 40 bold"
#w.g, "Color yellow"
'''''''''''''''''''''''''''''''''''' check for Mouse click
[top1]
Print #w.g, "When leftButtonDown [go1b]"
wait
[go1b]
prx=100 : pry=200
print #w.g, "goto ";prx;" ";pry
print #w.g, "\\ ";"MouseX="; MouseX;" "; "MouseY="; MouseY; " "
if MouseX>1230 and MouseY>770 then [done]
goto [top1]
''''''''''''''''''''''''''''''''''''''''''''''''''''' [done]
close #w
end
|
|
|
Post by alwichita2 on Feb 13, 2023 20:05:50 GMT -5
Yay ! I got it working ! This works just fine ! Thanks !
nomainwin
WindowHeight = 800 : WindowWidth = 1280 UpperLeftX = 0 UpperLeftY = 0
graphicbox #w.g, 0, 0, 1280, 800
open "bs" for window_popup as #w
''''''''''''''''''''''''''''''''''''
#w.g, "backcolor black" #w.g, "drawsprites"
#w.g, "font eurostile 20 bold" #w.g, "Color lightgray"
prx=50 : pry=50 #w.g, "goto ";prx;" ";pry #w.g, "\\ ";"Click anywhere to get Mouse Coordinates, bottom right conner to [EXIT] "
''''''''''''''''''''''''''''''''''''' #w.g, "font eurostile 40 bold" #w.g, "Color yellow"
'''''''''''''''''''''''''''''''''''' check for Mouse click [top1] #w.g "when leftButtonDown [button_ck]" timer 3000, [timer_ck] wait
[button_ck]
prx=100 : pry=200 #w.g, "goto ";prx;" ";pry #w.g, "\\ ";"MouseX="; MouseX;" "; "MouseY="; MouseY; " "
if MouseX>1230 and MouseY>770 then [done]
timer 0 goto [top1]
'''''''''''''''''''''''''''' [timer_ck] prx=100 : pry=300 print #w.g, "goto ";prx;" ";pry print #w.g, "\\ "; time$("ms")
timer 0 goto [top1] '''''''''''''''''''''''''''''''''''''''''''''''''''''
[done]
close #w
end
|
|