Mouse position: Difference between revisions

→‎{{header|Octave}}: input mouse position
(→‎{{header|Groovy}}: new solution)
(→‎{{header|Octave}}: input mouse position)
Line 359:
;;</lang>
 
 
=={{header|Octave}}==
To get the X,Y coordinates of N mouse clicks in the current figure, one can use this:
<lang Octave>[X, Y, BUTTONS] = ginput(N);</lang>
Example:
<pre>>> [X, Y, BUTTONS] = ginput(4)
X =
 
0.16113
0.26300
0.44343
0.23164
 
Y =
 
0.87357
0.87596
0.73330
0.54911
 
BUTTONS =
 
1
3
1
2
</pre>
 
=={{header|Oz}}==
Anonymous user