# testsuite_mouse_include section for BASIC256

# Modification History
# date		programmer	description
# 20140406	j.m.reneau	made spots larger for android testing
# 20140530	j.m.reneau	added mouseb statement test

# macos and android do not have 3 button mouses

rightbutton = ostype=0 or ostype=1
centerbutton = ostype=0 or ostype=1

clg
penwidth 1
color blue
rect 50,10,200,50
color red
rect 50,80,200,50
color green
rect 50,150,200,50
color black
circle 150,250,40
refresh

print "left click on the blue rectangle"
clickclear
while clickb <> 1
   pause .01
end while
call n("left click blue",pixel(clickx, clicky),blue)

if rightbutton then
   print "RIGHT click on the green rectangle"
   clickclear
   while clickb <> 2
      pause .01
   end while
   call n("right click green",pixel(clickx, clicky),green)
endif

if centerbutton then
   print "CENTER click on the RED rectangle"
   clickclear
   while clickb <> 4
      pause .01
   end while
   call n("center click red",pixel(clickx, clicky),red)
end if

print "move mouse over black dot"
while pixel(mousex, mousey)<> black
   pause .01
end while

print "click right mouse button"
a = msec
while mouseb <> 1
   pause .01
end while
print (msec - a) + " you took ms to press the button"
a = msec
while mouseb = 1
   pause .01
end while
print (msec - a) + " you presss the button for ms"
