Only xclick can catch callback execution.
[scilab.git] / scilab / modules / graphics / help / en_US / interaction / xclick.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) ENPC - Jean-Philippe Chancelier
5  * Copyright (C) 2008 - INRIA - Vincent COUVERT
6  *
7  * This file must be used under the terms of the CeCILL.
8  * This source file is licensed as described in the file COPYING, which
9  * you should have received as part of this distribution.  The terms
10  * are also available at
11  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
12  *
13  -->
14 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"  xml:id="xclick" xml:lang="en">
15     <refnamediv>
16         <refname>xclick</refname>
17         <refpurpose>Wait for a mouse click or an event in a graphic window.</refpurpose>
18     </refnamediv>
19     <refsynopsisdiv>
20         <title>Calling Sequence</title>
21         <synopsis>[ibutton,xcoord,yxcoord,iwin,cbmenu]=xclick([flag])</synopsis>
22     </refsynopsisdiv>
23     <refsection>
24         <title>Arguments</title>
25         <variablelist>
26             <varlistentry>
27                 <term>ibutton</term>
28                 <listitem>
29                     <para>Real scalar (integer value): mouse button number, event code...
30                         (See description below).
31                     </para>
32                 </listitem>
33             </varlistentry>
34             <varlistentry>
35                 <term>xcoord</term>
36                 <listitem>
37                     <para>Real scalar: x-ccordinate of the mouse pointer when
38                         the click or event occurred, in current graphic scale (see <link linkend="gca">gca()</link>).
39                     </para>
40                 </listitem>
41             </varlistentry>
42             <varlistentry>
43                 <term>ycoord</term>
44                 <listitem>
45                     <para>Real scalar: x-ccordinate of the mouse pointer when
46                         the click or event occurred, in current graphic scale (see <link linkend="gca">gca()</link>).
47                     </para>
48                 </listitem>
49             </varlistentry>
50             <varlistentry>
51                 <term>iwin</term>
52                 <listitem>
53                     <para>Real scalar (integer value): number of the window where the
54                         action occurred.
55                     </para>
56                 </listitem>
57             </varlistentry>
58             <varlistentry>
59                 <term>cbmenu</term>
60                 <listitem>
61                     <para>String: callback associated to a menu if
62                         <literal>xclick</literal> returns due to a click on a menu. In this
63                         case, <literal>ibutton</literal>, <literal>xcoord</literal>,
64                         <literal>ycoord</literal>, and <literal>iwin</literal> take
65                         arbitrary values.
66                     </para>
67                 </listitem>
68             </varlistentry>
69             <varlistentry>
70                 <term>flag</term>
71                 <listitem>
72                     <para>Real scalar (integer value): If present, the click event queue
73                         is not cleared when entering xclick.
74                     </para>
75                 </listitem>
76             </varlistentry>
77         </variablelist>
78     </refsection>
79     <refsection>
80         <title>Description</title>
81         <para>
82             <literal>xclick</literal> waits for a mouse click, a keyboard event, a menu activation or windows closure in the graphics
83             window. <literal>xclick</literal> prevents menu callback to be executed. Callback will be returned in <literal>cbmenu</literal>
84             return value.
85         </para>
86         <para>If it is called with 3 left hand side arguments, it waits for a
87             mouse click in the current graphics window.
88         </para>
89         <para>If it is called with 4 or 5 left hand side arguments, it waits for a
90             mouse click in any graphics window.
91         </para>
92         <para>
93             Warning, the returned coordinates <literal>xcoord</literal>,
94             <literal>ycoord</literal> are relative to the current axes (see <link linkend="gca">gca()</link>).
95         </para>
96         <para>
97             The values of <literal>ibutton</literal> are described below.
98         </para>
99         <variablelist>
100             <varlistentry>
101                 <term>ibutton==0</term>
102                 <listitem>
103                     <para>Left mouse button has been pressed.</para>
104                 </listitem>
105             </varlistentry>
106             <varlistentry>
107                 <term>ibutton==1</term>
108                 <listitem>
109                     <para>Middle mouse button has been pressed.</para>
110                 </listitem>
111             </varlistentry>
112             <varlistentry>
113                 <term>ibutton==2</term>
114                 <listitem>
115                     <para>Right mouse button has been pressed.</para>
116                     <para/>
117                 </listitem>
118             </varlistentry>
119             <varlistentry>
120                 <term>ibutton==3</term>
121                 <listitem>
122                     <para>Left mouse button has been clicked.</para>
123                 </listitem>
124             </varlistentry>
125             <varlistentry>
126                 <term>ibutton==4</term>
127                 <listitem>
128                     <para>Middle mouse button has been clicked.</para>
129                 </listitem>
130             </varlistentry>
131             <varlistentry>
132                 <term>ibutton==5</term>
133                 <listitem>
134                     <para>Right mouse button has been clicked.</para>
135                     <para/>
136                 </listitem>
137             </varlistentry>
138             <varlistentry>
139                 <term>ibutton==10</term>
140                 <listitem>
141                     <para>Left mouse button has been double-clicked.</para>
142                 </listitem>
143             </varlistentry>
144             <varlistentry>
145                 <term>ibutton==11</term>
146                 <listitem>
147                     <para>Middle mouse button has been double-clicked.</para>
148                 </listitem>
149             </varlistentry>
150             <varlistentry>
151                 <term>ibutton==12</term>
152                 <listitem>
153                     <para>Right mouse button has been double-clicked.</para>
154                     <para/>
155                 </listitem>
156             </varlistentry>
157             <varlistentry>
158                 <term>ibutton &gt;=32</term>
159                 <listitem>
160                     <para>
161                         key with ASCII code <literal>ibutton</literal> has been
162                         pressed.
163                     </para>
164                 </listitem>
165             </varlistentry>
166             <varlistentry>
167                 <term>ibutton &lt;=32</term>
168                 <listitem>
169                     <para>
170                         key with ASCII code <literal>-ibutton</literal> has been
171                         released.
172                     </para>
173                 </listitem>
174             </varlistentry>
175             <varlistentry>
176                 <term>ibutton &gt;=1000+32</term>
177                 <listitem>
178                     <para>
179                         key with ASCII code <literal>ibutton-1000</literal> has been
180                         pressed while CTRL key pressed.
181                     </para>
182                 </listitem>
183             </varlistentry>
184             <varlistentry>
185                 <term>ibutton==-1000</term>
186                 <listitem>
187                     <para>graphic window has been closed.</para>
188                     <para>
189                         WARNING: <literal>ibutton</literal> was equal to -100 for
190                         graphic window closure up to Scilab 4.1.2, but this code has been
191                         changed (in Scilab 5.0) because it was also the code returned for
192                         <literal>d</literal> key release.
193                     </para>
194                 </listitem>
195             </varlistentry>
196             <varlistentry>
197                 <term>ibutton==-2</term>
198                 <listitem>
199                     <para>A dynamic menu has been selected and its callback is returned
200                         in <literal>cbmenu</literal>.
201                     </para>
202                 </listitem>
203             </varlistentry>
204         </variablelist>
205     </refsection>
206     <refsection role="see also">
207         <title>See Also</title>
208         <simplelist type="inline">
209             <member>
210                 <link linkend="gca">gca</link>
211             </member>
212             <member>
213                 <link linkend="locate">locate</link>
214             </member>
215             <member>
216                 <link linkend="xgetmouse">xgetmouse</link>
217             </member>
218             <member>
219                 <link linkend="seteventhandler">seteventhandler</link>
220             </member>
221         </simplelist>
222     </refsection>
223 </refentry>