Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function
xclick
Wait for a mouse click.
Calling Sequence
[ibutton,xcoord,yxcoord,iwin,cbmenu]=xclick([flag])
Arguments
- ibutton
Real scalar (integer value): mouse button number, key code... (See description below).
- xcoord
Real scalar: x-ccordinate of the mouse pointer when the clic occured, in current graphic scale.
- ycoord
Real scalar: x-ccordinate of the mouse pointer when the clic occured, in current graphic scale.
- iwin
Real scalar (integer value): number of the window where the action occured.
- cbmenu
String: callback associated to a menu if
xclick
returns due to a click on a menu. In this case,ibutton
,xcoord
,ycoord
, andiwin
take arbitrary values.- flag
Real scalar (integer value): If present, the click event queue is not cleared when entering xclick.
Description
xclick
waits for a mouse click in the graphics
window.
If it is called with 3 left hand side arguments, it waits for a mouse click in the current graphics window.
If it is called with 4 or 5 left hand side arguments, it waits for a mouse click in any graphics window.
The values of ibutton
are described below.
- ibutton==0
Left mouse button has been pressed.
- ibutton==1
Middle mouse button has been pressed.
- ibutton==2
Right mouse button has been pressed.
- ibutton==3
Left mouse button has been clicked.
- ibutton==4
Middle mouse button has been clicked.
- ibutton==5
Right mouse button has been clicked.
- ibutton==10
Left mouse button has been double-clicked.
- ibutton==11
Middle mouse button has been double-clicked.
- ibutton==12
Right mouse button has been double-clicked.
- ibutton >=32
key with ASCII code
ibutton
has been pressed.- ibutton <=32
key with ASCII code
-ibutton
has been released.- ibutton >=1000+32
key with ASCII code
ibutton-1000
has been pressed while CTRL key pressed.- ibutton==-1000
graphic window has been closed.
WARNING:
ibutton
was equal to -100 for graphic window closure up to Scilab 4.1.2, but this code has been changed (in Scilab 5.0) because it was also the code returned ford
key release.- ibutton==-2
A dynamic menu has been selected and its callback is returned in
cbmenu
.
See Also
- locate — mouse selection of a set of points
- xgetmouse — get the mouse events and current position
- seteventhandler — set an event handler for the current graphic window
Authors
J.Ph.C.
V.C.
<< seteventhandler | interaction | xgetmouse >> |