function [clicks,x,y] = GetClicks
% [clicks,x,y] = GetClicks([windowPtrOrScreenNumber])
%
% Wait for the user to click the mouse, count the number of clicks
% that occur within a system inter-click interval of each other, and
% then return the number of clicks and the mouse location.
% 
% The x,y location is the location at the downstroke of the first mouse
% click. The mouse position (x,y) is "local", i.e. relative to the origin of
% the window or screen, if supplied; otherwise it's "global", i.e. relative
% to the origin of the main screen (the one with the menu bar).
%
% The allowed inter-click interval can be adjusted in the Mouse
% Control Panel: "double-click speed". The Macintosh function
% GetDblTime (or Windows GetDoubleClickTime) returns the 
% value of this constant, in Ticks. It can be set by LMSetDoubleTime.
%
% POSSIBLE ENHANCEMENT? If a sound was playing (see Snd), it is stopped 
% at the first mouse click. (The two MEX files don't communicate at present.)
%
% See Also: GetMouse, SetMouse

% 5/12/96  dgp  Wrote it.
% 5/16/96  dhb  Wrote as MEX-file, updated help.
% 6/7/96   dhb  Modified as per Pelli suggestion to respond to cmd-.
%          dhb  Modified as per Pelli suggestion to stop any playing sound.
% 8/23/96  dhb  Added support for windowPtr argument.
% 3/10/97  dgp	windowPtrOrScreenNumber
% 6/10/02  awi	Added See Also.  

