'\" t
.\"***************************************************************************
-.\" Copyright 2018-2021,2022 Thomas E. Dickey *
+.\" Copyright 2018-2022,2023 Thomas E. Dickey *
.\" Copyright 1998-2015,2017 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: curs_mouse.3x,v 1.58 2022/01/16 01:40:48 tom Exp $
+.\" $Id: curs_mouse.3x,v 1.66 2023/09/09 21:13:51 tom Exp $
.ie \n(.g .ds `` \(lq
.el .ds `` ``
.ie \n(.g .ds '' \(rq
.el .ds '' ''
+.ie n .ds CW R
+.el \{
+.ie \n(.g .ds CW CR
+.el .ds CW CW
+.\}
.de NS
.ie n .sp
.el .sp .5
.ie n .in +4
.el .in +2
.nf
-.ft C \" Courier
+.ft \*(CW
..
.de NE
.fi
.ie n .IP \(bu 4
.el .IP \(bu 2
..
-.TH curs_mouse 3X ""
+.TH curs_mouse 3X 2023-09-09 "ncurses 6.4" "Library calls"
.na
.hy 0
.SH NAME
.PP
.nf
\fBtypedef struct {\fP
-\fB short id; \fP\fI/* ID to distinguish multiple devices */\fP
-\fB int x, y, z; \fP\fI/* event coordinates */\fP
-\fB mmask_t bstate; \fP\fI/* button state bits */\fP
+\fB short id; \fI/* ID to distinguish multiple devices */\fR
+\fB int x, y, z; \fI/* event coordinates */\fR
+\fB mmask_t bstate; \fI/* button state bits */\fR
\fB} MEVENT;\fP
.fi
.PP
\fBbool has_mouse(void);\fP
.sp
-\fBint getmouse(MEVENT *\fP\fIevent\fP\fB);\fP
+\fBint getmouse(MEVENT *\fIevent\fB);\fR
.br
-\fBint ungetmouse(MEVENT *\fP\fIevent\fP\fB);\fP
+\fBint ungetmouse(MEVENT *\fIevent\fB);\fR
.sp
-\fBmmask_t mousemask(mmask_t \fP\fInewmask\fP\fB, mmask_t *\fP\fIoldmask\fP\fB);\fP
+\fBmmask_t mousemask(mmask_t \fInewmask\fB, mmask_t *\fIoldmask\fB);\fR
.sp
-\fBbool wenclose(const WINDOW *\fP\fIwin\fP\fB, int \fP\fIy\fP\fB, int \fP\fIx\fP\fB);\fP
+\fBbool wenclose(const WINDOW *\fIwin\fB, int \fIy\fB, int \fIx\fB);\fR
.sp
-\fBbool mouse_trafo(int* \fP\fIpY\fP\fB, int* \fP\fIpX\fP\fB, bool \fP\fIto_screen\fP\fB);\fP
+\fBbool mouse_trafo(int* \fIpY\fB, int* \fIpX\fB, bool \fIto_screen\fB);\fR
.br
-\fBbool wmouse_trafo(const WINDOW* \fP\fIwin\fP\fB,\fP
- \fBint* \fP\fIpY\fP\fB, int* \fP\fIpX\fP\fB, bool \fP\fIto_screen\fP\fB);\fP
+\fBbool wmouse_trafo(const WINDOW* \fIwin\fB,\fR
+ \fBint* \fIpY\fB, int* \fIpX\fB, bool \fIto_screen\fB);\fR
.sp
-\fBint mouseinterval(int \fP\fIerval\fP\fB);\fP
+\fBint mouseinterval(int \fIerval\fB);\fR
.br
.SH DESCRIPTION
These functions provide an interface to mouse events from
Mouse events are represented by \fBKEY_MOUSE\fP
pseudo-key values in the \fBwgetch\fP(3X) input stream.
.SS mousemask
-.PP
To make mouse events visible, use the \fBmousemask\fP function.
This sets the mouse events to be reported.
By default, no mouse events are reported.
setting a nonzero mask may turn it on.
Whether this happens is device-dependent.
.SS Mouse events
-.PP
Here are the mouse event type masks which may be defined:
.PP
.TS
_
.TE
.SS getmouse
-.PP
Once a class of mouse events has been made visible in a window,
calling the \fBwgetch\fP function on that window may return
\fBKEY_MOUSE\fP as an indicator that a mouse event has been queued.
A subsequent call to \fBgetmouse\fP will retrieve the next older
item from the queue.
.SS ungetmouse
-.PP
The \fBungetmouse\fP function behaves analogously to \fBungetch\fP.
It pushes
a \fBKEY_MOUSE\fP event onto the input queue, and associates with that event
the given state data and screen-relative character-cell coordinates.
.SS wenclose
-.PP
The \fBwenclose\fP function tests whether a given pair of screen-relative
character-cell coordinates is enclosed by a given window, returning \fBTRUE\fP
if it is and \fBFALSE\fP otherwise.
It is useful for determining what subset of
the screen windows enclose the location of a mouse event.
.SS wmouse_trafo
-.PP
The \fBwmouse_trafo\fP function transforms a given pair of coordinates
from stdscr-relative coordinates
to coordinates relative to the given window or vice versa.
are only replaced by the converted coordinates if the transformation was
successful.
.SS mouse_trafo
-.PP
The \fBmouse_trafo\fP function performs the same translation
as \fBwmouse_trafo\fP,
using stdscr for \fIwin\fP.
.SS mouseinterval
-.PP
The \fBmouseinterval\fP function sets the maximum time (in thousands of a
second) that can elapse between press and release events for them to
be recognized as a click.
Use \fBmouseinterval(\-1)\fP to obtain the interval without altering it.
The default is one sixth of a second.
.SS has_mouse
-.PP
The \fBhas_mouse\fP function returns \fBTRUE\fP if the mouse driver has been
successfully initialized.
.PP