aUCBLogo Demos and Tests / eventtest


to eventtest
;   textmouseeventtest
   
mouseeventtest
end

to keytest
   
OnChar 
   
[   c=KeyboardValue 
      
pr c 
      
if c==char 27 
      
[   OnChar [] 
         
OnKeyDown []
         
OnKeyUp []
      
]
   
]
   
OnKeyDown [(pr "down KeyboardValue)]
   
OnKeyUp [(pr "up KeyboardValue)]
end

to textmouseeventtest
   
disableTextMouseEvents
   
pr [Press any key to EXIT]
   
OnTextMouseLeftDown [(pr "LeftDown TextMouseX TextMouseY)]
   
OnTextMouseRightDown [(pr "RightDown TextMouseX TextMouseY)]
   
OnTextMouseMiddleDown [(pr "MiddleDown TextMouseX TextMouseY)]
   
OnTextMouseLeftUp [(pr "LeftUp TextMouseX TextMouseY)]
   
OnTextMouseRightUp [(pr "RightUp TextMouseX TextMouseY)]
   
OnTextMouseMiddleUp [(pr "MiddleUp TextMouseX TextMouseY)]
   
OnTextMouseLeftDClick [(pr "LeftDoubleClick TextMouseX TextMouseY)]
   
OnTextMouseRightDClick [(pr "RightDoubleClick TextMouseX TextMouseY)]
   
OnTextMouseMiddleDClick [(pr "MiddleDoubleClick TextMouseX TextMouseY)]
   
OnTextMouseMotion [(pr "Motion TextMouseX TextMouseY)]
   
OnChar 
   
[   enableTextMouseEvents
      
OnTextMouseLeftDown []
      
OnTextMouseRightDown []
      
OnTextMouseMiddleDown []
      
OnTextMouseLeftUp []
      
OnTextMouseRightUp []
      
OnTextMouseMiddleUp []
      
OnTextMouseLeftDClick []
      
OnTextMouseRightDClick []
      
OnTextMouseMiddleDClick []
      
OnTextMouseMotion []
      
OnChar []
   
]
end

to mouseeventtest
   
pr [Displaying Graphic Mouse eventsPress any key to EXIT]
   
OnMouseLeftDown [(pr "LeftDown MousePos)]
   
OnMouseRightDown [(pr "RightDown MousePos)]
   
OnMouseMiddleDown [(pr "MiddleDown MousePos)]
   
OnMouseLeftUp [(pr "LeftUp MousePos)]
   
OnMouseRightUp [(pr "RightUp MousePos)]
   
OnMouseMiddleUp [(pr "MiddleUp MousePos)]
   
OnMouseLeftDClick [(pr "LeftDoubleClick MousePos)]
   
OnMouseRightDClick [(pr "RightDoubleClick MousePos)]
   
OnMouseMiddleDClick [(pr "MiddleDoubleClick MousePos)]
   
OnMouseMotion [(pr "Motion MousePos)]
   
OnChar 
   
[   OnMouseLeftDown []
      
OnMouseRightDown []
      
OnMouseMiddleDown []
      
OnMouseLeftUp []
      
OnMouseRightUp []
      
OnMouseMiddleUp []
      
OnMouseLeftDClick []
      
OnMouseRightDClick []
      
OnMouseMiddleDClick []
      
OnMouseMotion []
      
OnChar []
   
]
end