blob: 8e5c7018134525ea2d8401adc66fe8cae9883625 [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301'\" t
2.\"***************************************************************************
micky3879b9f5e72025-07-08 18:04:53 -04003.\" Copyright 2018-2023,2024 Thomas E. Dickey *
4.\" Copyright 1998-2015,2017 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05305.\" *
6.\" Permission is hereby granted, free of charge, to any person obtaining a *
7.\" copy of this software and associated documentation files (the *
8.\" "Software"), to deal in the Software without restriction, including *
9.\" without limitation the rights to use, copy, modify, merge, publish, *
10.\" distribute, distribute with modifications, sublicense, and/or sell *
11.\" copies of the Software, and to permit persons to whom the Software is *
12.\" furnished to do so, subject to the following conditions: *
13.\" *
14.\" The above copyright notice and this permission notice shall be included *
15.\" in all copies or substantial portions of the Software. *
16.\" *
17.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
18.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
19.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
20.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
21.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
22.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
23.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
24.\" *
25.\" Except as contained in this notice, the name(s) of the above copyright *
26.\" holders shall not be used in advertising or otherwise to promote the *
27.\" sale, use or other dealings in this Software without prior written *
28.\" authorization. *
29.\"***************************************************************************
30.\"
micky3879b9f5e72025-07-08 18:04:53 -040031.\" $Id: curs_mouse.3x,v 1.98 2024/04/20 19:02:07 tom Exp $
32.TH curs_mouse 3X 2024-04-20 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls"
33.ie \n(.g \{\
34.ds `` \(lq
35.ds '' \(rq
36.\}
37.el \{\
38.ie t .ds `` ``
39.el .ds `` ""
40.ie t .ds '' ''
41.el .ds '' ""
42.\}
43.
Steve Kondikae271bc2015-11-15 02:50:53 +010044.de bP
micky3879b9f5e72025-07-08 18:04:53 -040045.ie n .IP \(bu 4
46.el .IP \(bu 2
Steve Kondikae271bc2015-11-15 02:50:53 +010047..
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053048.SH NAME
micky3879b9f5e72025-07-08 18:04:53 -040049\fB\%has_mouse\fP,
50\fB\%getmouse\fP,
51\fB\%ungetmouse\fP,
52\fB\%mousemask\fP,
53\fB\%wenclose\fP,
54\fB\%mouse_trafo\fP,
55\fB\%wmouse_trafo\fP,
56\fB\%mouseinterval\fP \-
57get mouse events in \fIcurses\fR
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053058.SH SYNOPSIS
59.nf
micky3879b9f5e72025-07-08 18:04:53 -040060\fB#include <curses.h>
Steve Kondikae271bc2015-11-15 02:50:53 +010061.PP
micky3879b9f5e72025-07-08 18:04:53 -040062\fBtypedef unsigned long mmask_t;
63.PP
64\fBtypedef struct {
65\fB short id; \fI/* ID to distinguish multiple devices */
66\fB int x, y, z; \fI/* event coordinates */
67\fB mmask_t bstate; \fI/* button state bits */
68\fB} MEVENT;
69.PP
70\fBbool has_mouse(void);
71.PP
72\fBmmask_t mousemask(mmask_t \fInewmask\fP, mmask_t *\fIoldmask\fP);
73.PP
74\fBint getmouse(MEVENT *\fIevent\fP);
75\fBint ungetmouse(MEVENT *\fIevent\fP);
76.PP
77\fBbool wenclose(const WINDOW *\fIwin\fP, int \fIy\fP, int \fIx\fP);
78.PP
79\fBbool mouse_trafo(int* \fIpY\fP, int* \fIpX\fP, bool \fIto_screen\fP);
80\fBbool wmouse_trafo(const WINDOW* \fIwin\fP,
81.ti +18n \" "bool wmouse_trafo("
82\fBint* \fIpY\fB, int* \fIpX\fB, bool \fIto_screen\fB);
83.PP
84\fBint mouseinterval(int \fIerval\fB);\fR
85.fi
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053086.SH DESCRIPTION
87These functions provide an interface to mouse events from
micky3879b9f5e72025-07-08 18:04:53 -040088\fB\%ncurses\fP(3X).
89Mouse events are represented by \fB\%KEY_MOUSE\fP
90pseudo-key values in the \fB\%wgetch\fP(3X) input stream.
91.SS has_mouse
92The \fB\%has_mouse\fP function returns \fBTRUE\fP if the mouse driver
93has been successfully initialized,
94and \fBFALSE\fP otherwise.
95.PP
96Mouse events are ignored when input is in cooked mode, and
97cause an error beep when cooked mode is being simulated in a window by a
98function such as \fB\%getstr\fP that expects a linefeed for input-loop
99termination.
Steve Kondikae271bc2015-11-15 02:50:53 +0100100.SS mousemask
micky3879b9f5e72025-07-08 18:04:53 -0400101To make mouse events visible, use the \fB\%mousemask\fP function.
102This sets the mouse events to be reported.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530103By default, no mouse events are reported.
micky3879b9f5e72025-07-08 18:04:53 -0400104.bP
105The function returns an updated copy of \fInewmask\fP
106to indicate which of the specified mouse events can be reported.
107.IP
108If the screen has not been initialized,
109or if the terminal does not support mouse-events,
110this function returns 0.
111.bP
112If \fIoldmask\fP is non-\fBNULL\fP,
113this function fills the indicated location with the previous value of the
114current screen's mouse event mask.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530115.PP
micky3879b9f5e72025-07-08 18:04:53 -0400116As a side effect, setting a zero mouse mask may turn off the mouse pointer;
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530117setting a nonzero mask may turn it on.
118Whether this happens is device-dependent.
micky3879b9f5e72025-07-08 18:04:53 -0400119.SS "Mouse Events"
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530120Here are the mouse event type masks which may be defined:
121.PP
122.TS
micky3879b9f5e72025-07-08 18:04:53 -0400123Lb Lb
124Lb Lx.
125Name Description
126=
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530127BUTTON1_PRESSED mouse button 1 down
128BUTTON1_RELEASED mouse button 1 up
129BUTTON1_CLICKED mouse button 1 clicked
130BUTTON1_DOUBLE_CLICKED mouse button 1 double clicked
131BUTTON1_TRIPLE_CLICKED mouse button 1 triple clicked
132_
133BUTTON2_PRESSED mouse button 2 down
134BUTTON2_RELEASED mouse button 2 up
135BUTTON2_CLICKED mouse button 2 clicked
136BUTTON2_DOUBLE_CLICKED mouse button 2 double clicked
137BUTTON2_TRIPLE_CLICKED mouse button 2 triple clicked
138_
139BUTTON3_PRESSED mouse button 3 down
140BUTTON3_RELEASED mouse button 3 up
141BUTTON3_CLICKED mouse button 3 clicked
142BUTTON3_DOUBLE_CLICKED mouse button 3 double clicked
143BUTTON3_TRIPLE_CLICKED mouse button 3 triple clicked
144_
145BUTTON4_PRESSED mouse button 4 down
146BUTTON4_RELEASED mouse button 4 up
147BUTTON4_CLICKED mouse button 4 clicked
148BUTTON4_DOUBLE_CLICKED mouse button 4 double clicked
149BUTTON4_TRIPLE_CLICKED mouse button 4 triple clicked
150_
151BUTTON5_PRESSED mouse button 5 down
152BUTTON5_RELEASED mouse button 5 up
153BUTTON5_CLICKED mouse button 5 clicked
154BUTTON5_DOUBLE_CLICKED mouse button 5 double clicked
155BUTTON5_TRIPLE_CLICKED mouse button 5 triple clicked
156_
micky3879b9f5e72025-07-08 18:04:53 -0400157BUTTON_SHIFT T{
158shift was down during button state change
159T}
160BUTTON_CTRL T{
161control was down during button state change
162T}
163BUTTON_ALT T{
164alt was down during button state change
165T}
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530166ALL_MOUSE_EVENTS report all button state changes
167REPORT_MOUSE_POSITION report mouse movement
168_
169.TE
Steve Kondikae271bc2015-11-15 02:50:53 +0100170.SS getmouse
Steve Kondikae271bc2015-11-15 02:50:53 +0100171Once a class of mouse events has been made visible in a window,
micky3879b9f5e72025-07-08 18:04:53 -0400172calling the \fB\%wgetch\fP function on that window may return
173\fB\%KEY_MOUSE\fP as an indicator that a mouse event has been queued.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530174To read the event data and pop the event off the queue, call
micky3879b9f5e72025-07-08 18:04:53 -0400175\fB\%getmouse\fP.
176This function will return \fBOK\fP if a mouse event
177is actually visible in the given window, \fBERR\fP otherwise.
178When \fB\%getmouse\fP returns \fBOK\fP, the data deposited as y and
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530179x in the event structure coordinates will be screen-relative character-cell
180coordinates.
181The returned state mask will have exactly one bit set to
182indicate the event type.
Steve Kondikae271bc2015-11-15 02:50:53 +0100183The corresponding data in the queue is marked invalid.
micky3879b9f5e72025-07-08 18:04:53 -0400184A subsequent call to \fB\%getmouse\fP will retrieve the next older
Steve Kondikae271bc2015-11-15 02:50:53 +0100185item from the queue.
186.SS ungetmouse
micky3879b9f5e72025-07-08 18:04:53 -0400187The \fB\%ungetmouse\fP function behaves analogously to \fB\%ungetch\fP.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530188It pushes
micky3879b9f5e72025-07-08 18:04:53 -0400189a \fB\%KEY_MOUSE\fP event onto the input queue, and associates with that event
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530190the given state data and screen-relative character-cell coordinates.
Steve Kondikae271bc2015-11-15 02:50:53 +0100191.SS wenclose
micky3879b9f5e72025-07-08 18:04:53 -0400192The \fB\%wenclose\fP function tests whether a given pair of screen-relative
Steve Kondikae271bc2015-11-15 02:50:53 +0100193character-cell coordinates is enclosed by a given window, returning \fBTRUE\fP
194if it is and \fBFALSE\fP otherwise.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530195It is useful for determining what subset of
196the screen windows enclose the location of a mouse event.
197.PP
micky3879b9f5e72025-07-08 18:04:53 -0400198If the parameter is a pad,
199\fB\%wenclose\fP uses the most recent screen coordinates used for
200this pad in
201\fB\%prefresh\fP(3X) or
202\fB\%pnoutrefresh\fP(3X).
203.SS wmouse_trafo
204The \fB\%wmouse_trafo\fP function transforms a given pair of coordinates
205from \fB\%stdscr\fP-relative coordinates
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530206to coordinates relative to the given window or vice versa.
micky3879b9f5e72025-07-08 18:04:53 -0400207The resulting \fB\%stdscr\fP-relative coordinates are not always
208identical to screen coordinates due to the mechanism to reserve
209lines on top or bottom of the screen for other purposes
210(see the \fB\%ripoffline\fP(3X) and \fB\%slk_init\fP(3X) calls, for example).
Steve Kondikae271bc2015-11-15 02:50:53 +0100211.bP
micky3879b9f5e72025-07-08 18:04:53 -0400212If the parameter \fIto_screen\fP is \fBTRUE\fP, the pointers
213\fIpY, pX\fP must reference the coordinates of a location
214inside the window \fIwin\fP.
215They are converted to \fB\%stdscr\fP-relative coordinates and returned
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530216through the pointers.
micky3879b9f5e72025-07-08 18:04:53 -0400217If the conversion was successful, the function returns \fBTRUE\fP.
218.IP
219If one of the parameters was \fBNULL\fP or the location is
220not inside the window, \fBFALSE\fP is returned.
Steve Kondikae271bc2015-11-15 02:50:53 +0100221.bP
micky3879b9f5e72025-07-08 18:04:53 -0400222If \fIto_screen\fP is
223\fBFALSE\fP, the pointers \fIpY, pX\fP must reference
224\fB\%stdscr\fP-relative coordinates.
225They are converted to window-relative coordinates if the
226window \fIwin\fP encloses this point.
227In this case the function returns \fBTRUE\fP.
228.IP
229If one of the parameters is \fBNULL\fP or the point is not inside the
230window, \fBFALSE\fP is returned.
231.PP
Steve Kondikae271bc2015-11-15 02:50:53 +0100232The referenced coordinates
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530233are only replaced by the converted coordinates if the transformation was
234successful.
Steve Kondikae271bc2015-11-15 02:50:53 +0100235.SS mouse_trafo
micky3879b9f5e72025-07-08 18:04:53 -0400236The \fB\%mouse_trafo\fP function performs the same translation
237as \fB\%wmouse_trafo\fP,
238using \fB\%stdscr\fP for \fIwin\fP.
Steve Kondikae271bc2015-11-15 02:50:53 +0100239.SS mouseinterval
micky3879b9f5e72025-07-08 18:04:53 -0400240The \fB\%mouseinterval\fP function sets the maximum time
241(in thousands of a second)
242that can elapse between press and release events for them to
243be resolved as a
244.IR click .
245An application might interpret button press and release events separated
246by more than the mouse interval as a \*(``long press\*('',
247or,
248with motion,
249as a \*(``drag\*(''.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530250.PP
micky3879b9f5e72025-07-08 18:04:53 -0400251Calling \fB\%mouseinterval(0)\fP disables click resolution.
252When
253.I \%ncurses
254detects a mouse event,
255it awaits further input activity up to this interval,
256and then checks for a subsequent mouse event which can be combined
257with the first event.
258If the timeout expires without input activity
259(which would happen with a zero interval),
260then no click resolution will occur.
261.PP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530262This function returns the previous interval value.
micky3879b9f5e72025-07-08 18:04:53 -0400263Use \fB\%mouseinterval(\-1)\fP to obtain the interval without altering it.
Steve Kondikae271bc2015-11-15 02:50:53 +0100264.PP
micky3879b9f5e72025-07-08 18:04:53 -0400265The mouse interval is set to one sixth of a second
266when the corresponding screen is initialized,
267e.g., in \fBinitscr\fP(3X) or \fBsetupterm\fP(3X).
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530268.SH RETURN VALUE
micky3879b9f5e72025-07-08 18:04:53 -0400269\fB\%has_mouse\fP,
270\fB\%wenclose\fP,
271\fB\%mouse_trafo\fP,
272and
273\fB\%wmouse_trafo\fP
274return \fBTRUE\fP or \fBFALSE\fP as noted above.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530275.PP
micky3879b9f5e72025-07-08 18:04:53 -0400276\fB\%getmouse\fP and \fB\%ungetmouse\fP
277return \fBERR\fP upon failure and \fBOK\fP upon success.
278.PP
279\fB\%getmouse\fP fails if:
280.bP
281no mouse driver was initialized,
282.bP
283the mask of reportable events is zero,
284.bP
285a mouse event was detected that does not match the mask,
286.bP
287or if no more events remain in the queue.
288.PP
289\fB\%ungetmouse\fP returns an error if the event queue is full.
290.PP
291\fB\%mousemask\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530292returns the mask of reportable events.
293.PP
micky3879b9f5e72025-07-08 18:04:53 -0400294\fB\%mouseinterval\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530295returns the previous interval value, unless
296the terminal was not initialized.
297In that case, it returns the maximum interval value (166).
micky3879b9f5e72025-07-08 18:04:53 -0400298.SH NOTES
299The order of the \fB\%MEVENT\fP structure members is not guaranteed.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530300Additional fields may be added to the structure in the future.
301.PP
micky3879b9f5e72025-07-08 18:04:53 -0400302Under
303.IR \%ncurses ,
304these calls are implemented using either
305.IR \%xterm 's
306built-in mouse-tracking API or
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530307platform-specific drivers including
Steve Kondikae271bc2015-11-15 02:50:53 +0100308.RS 3
309.bP
310Alessandro Rubini's gpm server
311.bP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530312FreeBSD sysmouse
Steve Kondikae271bc2015-11-15 02:50:53 +0100313.bP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530314OS/2 EMX
315.RE
Steve Kondikae271bc2015-11-15 02:50:53 +0100316.PP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530317If you are using an unsupported configuration,
318mouse events will not be visible to
micky3879b9f5e72025-07-08 18:04:53 -0400319\fI\%ncurses\fP (and the \fB\%mousemask\fP function will always
320return \fB0\fP).
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530321.PP
micky3879b9f5e72025-07-08 18:04:53 -0400322If the
323.I \%term\%info
324entry contains a \fBXM\fP string,
325this is used in the
326.I \%xterm
327mouse driver to control the
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530328way the terminal is initialized for mouse operation.
micky3879b9f5e72025-07-08 18:04:53 -0400329The default, if \fBXM\fP is not found,
330corresponds to private mode 1000 of
331.I \%xterm:
Steve Kondikae271bc2015-11-15 02:50:53 +0100332.PP
333.RS 3
micky3879b9f5e72025-07-08 18:04:53 -0400334\eE[?1000%?%p1%{1}%=%th%el%;
335.RE
336.PP
337The mouse driver also recognizes a newer
338.I \%xterm
339private mode 1006,
340e.g.,
341.PP
342.RS 3
343\eE[?1006;1000%?%p1%{1}%=%th%el%;
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530344.RE
Steve Kondikae271bc2015-11-15 02:50:53 +0100345.PP
346The \fIz\fP member in the event structure is not presently used.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530347It is intended
348for use with touch screens (which may be pressure-sensitive) or with
3493D-mice/trackballs/power gloves.
Steve Kondikae271bc2015-11-15 02:50:53 +0100350.PP
micky3879b9f5e72025-07-08 18:04:53 -0400351The \fB\%ALL_MOUSE_EVENTS\fP class does not
352include \fB\%REPORT_MOUSE_POSITION\fP.
Steve Kondikae271bc2015-11-15 02:50:53 +0100353They are distinct.
micky3879b9f5e72025-07-08 18:04:53 -0400354For example,
355in
356.IR \%xterm ,
Steve Kondikae271bc2015-11-15 02:50:53 +0100357wheel/scrolling mice send position reports as a sequence of
358presses of buttons 4 or 5 without matching button-releases.
micky3879b9f5e72025-07-08 18:04:53 -0400359.SH EXTENSIONS
360These functions were designed for
361\fB\%ncurses\fP(3X),
362and are not found in SVr4
363.IR curses ,
3644.4BSD
365.IR curses ,
366or any other previous curses implementation.
367(SVr4
368.I curses
369did have a
370.I \%getmouse
371function,
372which took no argument and returned a different type.)
373.SH PORTABILITY
374Applications employing the
375.I \%ncurses
376mouse extension should condition its use on the visibility of the
377.B \%NCURSES_MOUSE_VERSION
378preprocessor macro.
379When the interface changes,
380the macro's value increments.
381Multiple versions are available when
382.I \%ncurses
383is configured;
384see section \*(``ALTERNATE CONFIGURATIONS\*('' of \fB\%ncurses\fP(3X).
385The following values may be specified.
386.RS 3
387.TP 3
3881
389has definitions for reserved events.
390The mask uses 28 bits.
391.TP 3
3922
393adds definitions for button 5,
394removes the definitions for reserved events.
395The mask uses 29 bits.
396.RE
397.PP
398SVr4
399.I curses
400had support for the mouse in a variant of \fI\%xterm\fP(1).
401It is mentioned in a few places,
402with little supporting documentation.
403.bP
404Its \*(``libcurses\*('' manual page lists functions for this feature
405prototyped in \fI\%curses.h\fP.
406.PP
407.RS 8
408.EX
409extern int mouse_set(long int);
410extern int mouse_on(long int);
411extern int mouse_off(long int);
412extern int request_mouse_pos(void);
413extern int map_button(unsigned long);
414extern void wmouse_position(WINDOW *, int *, int *);
415extern unsigned long getmouse(void), getbmap(void);
416.EE
417.RE
418.bP
419Its \*(``terminfo\*('' manual page lists capabilities for the feature.
420.\" These don't appear in in the SVID 4th edition, Volume 3,
421.\" terminfo(TI_ENV) man page. They can be found in, e.g., the "z/OS
422.\" V1R1.0 C Curses" book, Chapter 17, pp. 179-186 (PDF 213-220).
423.RS 8
424.TS
425Lb Lb Lb Lx.
426buttons btns BT T{
427Number of buttons on the mouse
428T}
429get_mouse getm Gm T{
430Curses should get button events
431T}
432key_mouse kmous Km T{
4330631, Mouse event has occurred
434T}
435mouse_info minfo Mi T{
436Mouse status information
437T}
438req_mouse_pos reqmp RQ T{
439Request mouse position report
440T}
441.TE
442.RE
443.bP
444The interface made assumptions
445(as does
446.IR \%ncurses )
447about the escape sequences sent to and received from the terminal.
448.IP
449For instance,
450the SVr4
451.I curses
452library used the \fB\%get_mouse\fP capability to tell the terminal which
453mouse button events it should send,
454passing the mouse-button bit mask to the terminal.
455Also, it could ask the terminal
456where the mouse was using the \fB\%req_mouse_pos\fP capability.
457.IP
458Those features required a terminal program that had been modified
459to work with SVr4
460.IR curses .
461They were not part of the X Consortium's
462.IR \%xterm .
463.PP
464When developing the
465.I \%xterm
466mouse support for
467.I \%ncurses
468in September 1995,
469Eric Raymond was uninterested in using the same interface due to its
470lack of documentation.
471Later, in 1998, Mark Hesseling provided support in
472.I \%PDCurses
4732.3 using the SVr4 interface.
474.IR \%PDCurses ,
475however,
476does not use video terminals,
477making it unnecessary to be concerned about compatibility with the
478escape sequences.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530479.SH BUGS
micky3879b9f5e72025-07-08 18:04:53 -0400480Mouse events from
481.I \%xterm
482are
483.I not
484ignored in cooked mode if they have been enabled by \fB\%mousemask\fP.
485Instead,
486the
487.I \%xterm
488mouse report sequence appears in the string read.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530489.PP
micky3879b9f5e72025-07-08 18:04:53 -0400490Mouse event reports from
491.I \%xterm
492are not detected correctly in a window with keypad application mode
493disabled,
494since they are interpreted as a variety of function key.
495Set the terminal's
496.I \%term\%info
497capability \fB\%kmous\fP to \*(``\eE[M\*(''
498(the beginning of the response from
499.I \%xterm
500for mouse clicks).
501Other values of \fB\%kmous\fP are permitted under the same assumption,
502that is,
503the report begins with that sequence.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530504.PP
micky3879b9f5e72025-07-08 18:04:53 -0400505Because there are no standard response sequences that serve to identify
506terminals supporting the
507.I \%xterm
508mouse protocol,
509.I \%ncurses
510assumes that if \fB\%kmous\fP is defined in the terminal description,
511or if the terminal type's primary name or aliases contain the string
512\%\*(``xterm\*('',
513then the terminal may send mouse events.
514The \fB\%kmous\fP capability is checked first,
515allowing use of newer
516.I \%xterm
517mouse protocols,
518such as its private mode 1006.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530519.SH SEE ALSO
micky3879b9f5e72025-07-08 18:04:53 -0400520\fB\%curses\fP(3X),
521\fB\%curs_inopts\fP(3X),
522\fB\%curs_kernel\fP(3X),
523\fB\%curs_pad\fP(3X),
524\fB\%curs_slk\fP(3X),
525\fB\%curs_variables\fP(3X)