53338f5aa2dc70e0c2c48279131be03000126643
[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 or other events in the graphics
83             window.
84         </para>
85         <para>If it is called with 3 left hand side arguments, it waits for a
86             mouse click in the current graphics window.
87         </para>
88         <para>If it is called with 4 or 5 left hand side arguments, it waits for a
89             mouse click in any graphics window.
90         </para>
91         <para>
92             Warning, the returned coordinates <literal>xcoord</literal>,
93             <literal>ycoord</literal> are relative to the current axes (see <link linkend="gca">gca()</link>).
94         </para>
95         <para>
96             The values of <literal>ibutton</literal> are described below.
97         </para>
98         <variablelist>
99             <varlistentry>
100                 <term>ibutton==0</term>
101                 <listitem>
102                     <para>Left mouse button has been pressed.</para>
103                 </listitem>
104             </varlistentry>
105             <varlistentry>
106                 <term>ibutton==1</term>
107                 <listitem>
108                     <para>Middle mouse button has been pressed.</para>
109                 </listitem>
110             </varlistentry>
111             <varlistentry>
112                 <term>ibutton==2</term>
113                 <listitem>
114                     <para>Right mouse button has been pressed.</para>
115                     <para/>
116                 </listitem>
117             </varlistentry>
118             <varlistentry>
119                 <term>ibutton==3</term>
120                 <listitem>
121                     <para>Left mouse button has been clicked.</para>
122                 </listitem>
123             </varlistentry>
124             <varlistentry>
125                 <term>ibutton==4</term>
126                 <listitem>
127                     <para>Middle mouse button has been clicked.</para>
128                 </listitem>
129             </varlistentry>
130             <varlistentry>
131                 <term>ibutton==5</term>
132                 <listitem>
133                     <para>Right mouse button has been clicked.</para>
134                     <para/>
135                 </listitem>
136             </varlistentry>
137             <varlistentry>
138                 <term>ibutton==10</term>
139                 <listitem>
140                     <para>Left mouse button has been double-clicked.</para>
141                 </listitem>
142             </varlistentry>
143             <varlistentry>
144                 <term>ibutton==11</term>
145                 <listitem>
146                     <para>Middle mouse button has been double-clicked.</para>
147                 </listitem>
148             </varlistentry>
149             <varlistentry>
150                 <term>ibutton==12</term>
151                 <listitem>
152                     <para>Right mouse button has been double-clicked.</para>
153                     <para/>
154                 </listitem>
155             </varlistentry>
156             <varlistentry>
157                 <term>ibutton &gt;=32</term>
158                 <listitem>
159                     <para>
160                         key with ASCII code <literal>ibutton</literal> has been
161                         pressed.
162                     </para>
163                 </listitem>
164             </varlistentry>
165             <varlistentry>
166                 <term>ibutton &lt;=32</term>
167                 <listitem>
168                     <para>
169                         key with ASCII code <literal>-ibutton</literal> has been
170                         released.
171                     </para>
172                 </listitem>
173             </varlistentry>
174             <varlistentry>
175                 <term>ibutton &gt;=1000+32</term>
176                 <listitem>
177                     <para>
178                         key with ASCII code <literal>ibutton-1000</literal> has been
179                         pressed while CTRL key pressed.
180                     </para>
181                 </listitem>
182             </varlistentry>
183             <varlistentry>
184                 <term>ibutton==-1000</term>
185                 <listitem>
186                     <para>graphic window has been closed.</para>
187                     <para>
188                         WARNING: <literal>ibutton</literal> was equal to -100 for
189                         graphic window closure up to Scilab 4.1.2, but this code has been
190                         changed (in Scilab 5.0) because it was also the code returned for
191                         <literal>d</literal> key release.
192                     </para>
193                 </listitem>
194             </varlistentry>
195             <varlistentry>
196                 <term>ibutton==-2</term>
197                 <listitem>
198                     <para>A dynamic menu has been selected and its callback is returned
199                         in <literal>cbmenu</literal>.
200                     </para>
201                 </listitem>
202             </varlistentry>
203         </variablelist>
204     </refsection>
205     <refsection role="see also">
206         <title>See Also</title>
207         <simplelist type="inline">
208             <member>
209                 <link linkend="gca">gca</link>
210             </member>
211             <member>
212                 <link linkend="locate">locate</link>
213             </member>
214             <member>
215                 <link linkend="xgetmouse">xgetmouse</link>
216             </member>
217             <member>
218                 <link linkend="seteventhandler">seteventhandler</link>
219             </member>
220         </simplelist>
221     </refsection>
222 </refentry>