+ <STRONG>o</STRONG> If the parameter <EM>to</EM><STRONG>_</STRONG><EM>screen</EM> is <STRONG>TRUE</STRONG>, the pointers <EM>pY,</EM> <EM>pX</EM> must
+ reference the coordinates of a location inside the window <EM>win</EM>.
+ They are converted to <STRONG>stdscr</STRONG>-relative coordinates and returned
+ through the pointers. If the conversion was successful, the
+ function returns <STRONG>TRUE</STRONG>.
+
+ If one of the parameters was <STRONG>NULL</STRONG> or the location is not inside the
+ window, <STRONG>FALSE</STRONG> is returned.
+
+ <STRONG>o</STRONG> If <EM>to</EM><STRONG>_</STRONG><EM>screen</EM> is <STRONG>FALSE</STRONG>, the pointers <EM>pY,</EM> <EM>pX</EM> must reference
+ <STRONG>stdscr</STRONG>-relative coordinates. They are converted to window-relative
+ coordinates if the window <EM>win</EM> encloses this point. In this case
+ the function returns <STRONG>TRUE</STRONG>.
+
+ If one of the parameters is <STRONG>NULL</STRONG> or the point is not inside the
+ window, <STRONG>FALSE</STRONG> is returned.
+
+ The referenced coordinates are only replaced by the converted
+ coordinates if the transformation was successful.
+
+
+</PRE><H3><a name="h3-mouse_trafo">mouse_trafo</a></H3><PRE>
+ The <STRONG>mouse_trafo</STRONG> function performs the same translation as <STRONG>wmouse_trafo</STRONG>,
+ using <STRONG>stdscr</STRONG> for <EM>win</EM>.
+
+
+</PRE><H3><a name="h3-mouseinterval">mouseinterval</a></H3><PRE>
+ The <STRONG>mouseinterval</STRONG> function sets the maximum time (in thousands of a
+ second) that can elapse between press and release events for them to be
+ resolved as a <EM>click</EM>. An application might interpret button press and
+ release events separated by more than the mouse interval as a "long
+ press", or, with motion, as a "drag".
+
+ Calling <STRONG>mouseinterval(0)</STRONG> disables click resolution. When <EM>ncurses</EM>
+ detects a mouse event, it awaits further input activity up to this
+ interval, and then checks for a subsequent mouse event which can be
+ combined with the first event. If the timeout expires without input
+ activity (which would happen with a zero interval), then no click
+ resolution will occur.
+
+ This function returns the previous interval value. Use
+ <STRONG>mouseinterval(-1)</STRONG> to obtain the interval without altering it.
+
+ The mouse interval is set to one sixth of a second when the
+ corresponding screen is initialized, e.g., in <STRONG><A HREF="curs_initscr.3x.html">initscr(3x)</A></STRONG> or
+ <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG>.
+
+
+</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
+ <STRONG>has_mouse</STRONG>, <STRONG>wenclose</STRONG>, <STRONG>mouse_trafo</STRONG>, and <STRONG>wmouse_trafo</STRONG> return <STRONG>TRUE</STRONG> or <STRONG>FALSE</STRONG>
+ as noted above.
+
+ <STRONG>getmouse</STRONG> and <STRONG>ungetmouse</STRONG> return <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> upon success.
+
+ <STRONG>getmouse</STRONG> fails if:
+
+ <STRONG>o</STRONG> no mouse driver was initialized,
+
+ <STRONG>o</STRONG> the mask of reportable events is zero,
+
+ <STRONG>o</STRONG> a mouse event was detected that does not match the mask,
+
+ <STRONG>o</STRONG> or if no more events remain in the queue.
+
+ <STRONG>ungetmouse</STRONG> returns an error if the event queue is full.
+
+ <STRONG>mousemask</STRONG> returns the mask of reportable events.
+
+ <STRONG>mouseinterval</STRONG> returns the previous interval value, unless the terminal
+ was not initialized. In that case, it returns the maximum interval
+ value (166).
+
+
+</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
+ The order of the <STRONG>MEVENT</STRONG> structure members is not guaranteed.
+ Additional fields may be added to the structure in the future.
+
+ Under <EM>ncurses</EM>, these calls are implemented using either <EM>xterm</EM>'s built-
+ in mouse-tracking API or platform-specific drivers including
+
+ <STRONG>o</STRONG> Alessandro Rubini's gpm server
+
+ <STRONG>o</STRONG> FreeBSD sysmouse
+
+ <STRONG>o</STRONG> OS/2 EMX
+
+ If you are using an unsupported configuration, mouse events will not be
+ visible to <EM>ncurses</EM> (and the <STRONG>mousemask</STRONG> function will always return <STRONG>0</STRONG>).
+
+ If the <EM>terminfo</EM> entry contains a <STRONG>XM</STRONG> string, this is used in the <EM>xterm</EM>
+ mouse driver to control the way the terminal is initialized for mouse
+ operation. The default, if <STRONG>XM</STRONG> is not found, corresponds to private
+ mode 1000 of <EM>xterm:</EM>
+
+ \E[?1000%?%p1%{1}%=%th%el%;
+
+ The mouse driver also recognizes a newer <EM>xterm</EM> private mode 1006, e.g.,
+
+ \E[?1006;1000%?%p1%{1}%=%th%el%;
+
+ The <EM>z</EM> member in the event structure is not presently used. It is
+ intended for use with touch screens (which may be pressure-sensitive)
+ or with 3D-mice/trackballs/power gloves.
+
+ The <STRONG>ALL_MOUSE_EVENTS</STRONG> class does not include <STRONG>REPORT_MOUSE_POSITION</STRONG>.
+ They are distinct. For example, in <EM>xterm</EM>, wheel/scrolling mice send
+ position reports as a sequence of presses of buttons 4 or 5 without
+ matching button-releases.
+
+
+</PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
+ These functions were designed for <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>, and are not found in
+ SVr4 <EM>curses</EM>, 4.4BSD <EM>curses</EM>, or any other previous curses
+ implementation. (SVr4 <EM>curses</EM> did have a <EM>getmouse</EM> function, which took
+ no argument and returned a different type.)
+
+
+</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
+ Applications employing the <EM>ncurses</EM> mouse extension should condition its
+ use on the visibility of the <STRONG>NCURSES_MOUSE_VERSION</STRONG> preprocessor macro.
+ When the interface changes, the macro's value increments. Multiple
+ versions are available when <EM>ncurses</EM> is configured; see section
+ "ALTERNATE CONFIGURATIONS" of <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>. The following values may be
+ specified.
+
+ 1 has definitions for reserved events. The mask uses 28 bits.
+
+ 2 adds definitions for button 5, removes the definitions for
+ reserved events. The mask uses 29 bits.
+
+ SVr4 <EM>curses</EM> had support for the mouse in a variant of <STRONG>xterm(1)</STRONG>. It is
+ mentioned in a few places, with little supporting documentation.
+
+ <STRONG>o</STRONG> Its "libcurses" manual page lists functions for this feature
+ prototyped in <EM>curses.h</EM>.
+
+ extern int mouse_set(long int);
+ extern int mouse_on(long int);
+ extern int mouse_off(long int);
+ extern int request_mouse_pos(void);
+ extern int map_button(unsigned long);
+ extern void wmouse_position(WINDOW *, int *, int *);
+ extern unsigned long getmouse(void), getbmap(void);
+
+ <STRONG>o</STRONG> Its "terminfo" manual page lists capabilities for the feature.
+
+ <STRONG>buttons</STRONG> <STRONG>btns</STRONG> <STRONG>BT</STRONG> Number of buttons on the mouse
+ <STRONG>get_mouse</STRONG> <STRONG>getm</STRONG> <STRONG>Gm</STRONG> Curses should get button events
+ <STRONG>key_mouse</STRONG> <STRONG>kmous</STRONG> <STRONG>Km</STRONG> 0631, Mouse event has occurred
+ <STRONG>mouse_info</STRONG> <STRONG>minfo</STRONG> <STRONG>Mi</STRONG> Mouse status information
+ <STRONG>req_mouse_pos</STRONG> <STRONG>reqmp</STRONG> <STRONG>RQ</STRONG> Request mouse position report
+
+ <STRONG>o</STRONG> The interface made assumptions (as does <EM>ncurses</EM>) about the escape
+ sequences sent to and received from the terminal.
+
+ For instance, the SVr4 <EM>curses</EM> library used the <STRONG>get_mouse</STRONG> capability
+ to tell the terminal which mouse button events it should send,
+ passing the mouse-button bit mask to the terminal. Also, it could
+ ask the terminal where the mouse was using the <STRONG>req_mouse_pos</STRONG>
+ capability.
+
+ Those features required a terminal program that had been modified
+ to work with SVr4 <EM>curses</EM>. They were not part of the X Consortium's
+ <EM>xterm</EM>.
+
+ When developing the <EM>xterm</EM> mouse support for <EM>ncurses</EM> in September 1995,
+ Eric Raymond was uninterested in using the same interface due to its
+ lack of documentation. Later, in 1998, Mark Hesseling provided support
+ in <EM>PDCurses</EM> 2.3 using the SVr4 interface. <EM>PDCurses</EM>, however, does not
+ use video terminals, making it unnecessary to be concerned about
+ compatibility with the escape sequences.
+
+
+</PRE><H2><a name="h2-BUGS">BUGS</a></H2><PRE>
+ Mouse events from <EM>xterm</EM> are <EM>not</EM> ignored in cooked mode if they have
+ been enabled by <STRONG>mousemask</STRONG>. Instead, the <EM>xterm</EM> mouse report sequence
+ appears in the string read.
+
+ An <EM>ncurses</EM> window must enable <STRONG><A HREF="curs_inopts.3x.html">keypad(3x)</A></STRONG> to correctly receive mouse
+ event reports from <EM>xterm</EM> since they are encoded like function keys.
+ Set the terminal's <EM>terminfo</EM> capability <STRONG>kmous</STRONG> to "\E[M" (the beginning
+ of the response from <EM>xterm</EM> for mouse clicks). Other values of <STRONG>kmous</STRONG>
+ are permitted under the same assumption, that is, the report begins
+ with that sequence.
+
+ Because there are no standard response sequences that serve to identify
+ terminals supporting the <EM>xterm</EM> mouse protocol, <EM>ncurses</EM> assumes that if
+ <STRONG>kmous</STRONG> is defined in the terminal description, or if the terminal type's
+ primary name or aliases contain the string "xterm", then the terminal
+ may send mouse events. The <STRONG>kmous</STRONG> capability is checked first, allowing
+ use of newer <EM>xterm</EM> mouse protocols, such as its private mode 1006.
+
+
+</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
+ <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3x)</A></STRONG>, <STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3x)</A></STRONG>, <STRONG><A HREF="curs_pad.3x.html">curs_pad(3x)</A></STRONG>,
+ <STRONG><A HREF="curs_slk.3x.html">curs_slk(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>