Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 591c941c2fdf0a32dc57bb5f10791cde > files > 573

gnuplot-doc-4.4.0-5.fc14.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<!--Converted with LaTeX2HTML 2008 (1.71)
original version by:  Nikos Drakos, CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>Mouse variables</TITLE>
<META NAME="description" CONTENT="Mouse variables">
<META NAME="keywords" CONTENT="gnuplot">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">

<META NAME="Generator" CONTENT="LaTeX2HTML v2008">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="gnuplot.css">

<LINK REL="previous" HREF="node42.html">
<LINK REL="up" HREF="node41.html">
<LINK REL="next" HREF="node45.html">
</HEAD>

<BODY >
<!--Navigation Panel-->
<A NAME="tex2html1364"
  HREF="node45.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html1358"
  HREF="node41.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html1354"
  HREF="node43.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html1360"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html1362"
  HREF="node467.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html1365"
  HREF="node45.html">Plotting</A>
<B> Up:</B> <A NAME="tex2html1359"
  HREF="node41.html">Mouse input</A>
<B> Previous:</B> <A NAME="tex2html1355"
  HREF="node43.html">Bind space</A>
 &nbsp; <B>  <A NAME="tex2html1361"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html1363"
  HREF="node467.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->

<H2><A NAME="SECTION020172000000000000000"></A>
<A NAME="mouse_variables"></A>
<BR>
Mouse variables
</H2>
When <B>mousing</B> is active, clicking in the active window will set several user
variables that can be accessed from the gnuplot command line. The coordinates
of the mouse at the time of the click are stored in MOUSE_X MOUSE_Y MOUSE_X2
and MOUSE_Y2. The mouse button clicked, and any meta-keys active at that time,
are stored in MOUSE_BUTTON MOUSE_SHIFT MOUSE_ALT and MOUSE_CTRL.  These
variables are set to undefined at the start of every plot, and only become
defined in the event of a mouse click in the active plot window. To determine
from a script if the mouse has been clicked in the active plot window, it is
sufficient to test for any one of these variables being defined.

<P>
<BR>
<PRE>
     plot 'something'
     pause mouse
     if (defined(MOUSE_BUTTON)) call 'something_else'; \
     else print "No mouse click."
</PRE>
<BR>

<P>
It is also possible to track keystrokes in the plot window using the mousing
code.

<P>
<BR>
<PRE>
     plot 'something'
     pause mouse keypress
     print "Keystroke ", MOUSE_KEY, " at ", MOUSE_X, " ", MOUSE_Y
</PRE>
<BR>

<P>
When <B>pause mouse keypress</B> is terminated by a keypress, then MOUSE_KEY will
contain the ascii character value of the key that was pressed. MOUSE_CHAR will
contain the character itself as a string variable.  If the pause command is
terminated abnormally (e.g. by ctrl-C or by externally closing the plot window)
then MOUSE_KEY will equal -1.

<P>
Note that after a zoom by mouse, you can read the new ranges as GPVAL_X_MIN,
GPVAL_X_MAX, GPVAL_Y_MIN, and GPVAL_Y_MAX, see <B>gnuplot-defined variables (p.&nbsp;<A HREF="node30.html#gnuplot-defined_variables"><IMG  ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)<A NAME="1252"></A></B>.

<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html1364"
  HREF="node45.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html1358"
  HREF="node41.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html1354"
  HREF="node43.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html1360"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html1362"
  HREF="node467.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html1365"
  HREF="node45.html">Plotting</A>
<B> Up:</B> <A NAME="tex2html1359"
  HREF="node41.html">Mouse input</A>
<B> Previous:</B> <A NAME="tex2html1355"
  HREF="node43.html">Bind space</A>
 &nbsp; <B>  <A NAME="tex2html1361"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html1363"
  HREF="node467.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>

2010-08-17
</ADDRESS>
</BODY>
</HTML>