]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - man/curs_mouse.3x
ncurses 5.9 - patch 20150321
[ncurses.git] / man / curs_mouse.3x
index 8dbabca5bd7bf9e6e91c3a27f37b6d0f88ad61dc..5272de924b02ed9481643f830a632a643a4d29b7 100644 (file)
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2013,2014 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,7 +27,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_mouse.3x,v 1.32 2009/08/29 18:11:58 tom Exp $
+.\" $Id: curs_mouse.3x,v 1.40 2014/10/10 09:31:18 tom Exp $
 .TH curs_mouse 3X ""
 .na
 .hy 0
 .TH curs_mouse 3X ""
 .na
 .hy 0
 \fBgetmouse\fR, \fBungetmouse\fR,
 \fBmousemask\fR, \fBwenclose\fR,
 \fBmouse_trafo\fR, \fBwmouse_trafo\fR,
 \fBgetmouse\fR, \fBungetmouse\fR,
 \fBmousemask\fR, \fBwenclose\fR,
 \fBmouse_trafo\fR, \fBwmouse_trafo\fR,
-\fBmouseinterval\fR - mouse interface through curses
+\fBmouseinterval\fR \- mouse interface through curses
 .ad
 .hy
 .SH SYNOPSIS
 .ad
 .hy
 .SH SYNOPSIS
-.nf
-\fB#include <curses.h>
+\fB#include <curses.h>\fR
 .PP
 .PP
-\fBtypedef unsigned long mmask_t;
+\fBtypedef unsigned long mmask_t;\fR
 .PP
 .PP
-typedef struct
-{
-    short id;         \fI/* ID to distinguish multiple devices */\fB
-    int x, y, z;      \fI/* event coordinates */\fB
-    mmask_t bstate;   \fI/* button state bits */\fB
-}
-MEVENT;\fR
+.nf
+\fBtypedef struct {\fR
+\fB    short id;         \fR\fI/* ID to distinguish multiple devices */\fR
+\fB    int x, y, z;      \fR\fI/* event coordinates */\fR
+\fB    mmask_t bstate;   \fR\fI/* button state bits */\fR
+\fB} MEVENT;\fR
 .fi
 .fi
-.br
+.PP
 \fBbool has_mouse(void);\fR
 .br
 \fBbool has_mouse(void);\fR
 .br
--\fBint getmouse(MEVENT *event);\fR
+\fBint getmouse(MEVENT *event);\fR
 .br
 \fBint ungetmouse(MEVENT *event);\fR
 .br
 .br
 \fBint ungetmouse(MEVENT *event);\fR
 .br
@@ -137,7 +135,7 @@ REPORT_MOUSE_POSITION       report mouse movement
 _
 .TE
 .PP
 _
 .TE
 .PP
-Once a class of mouse events have been made visible in a window,
+Once a class of mouse events has been made visible in a window,
 calling the \fBwgetch\fR function on that window may return
 \fBKEY_MOUSE\fR as an indicator that a mouse event has been queued.
 To read the event data and pop the event off the queue, call
 calling the \fBwgetch\fR function on that window may return
 \fBKEY_MOUSE\fR as an indicator that a mouse event has been queued.
 To read the event data and pop the event off the queue, call
@@ -149,6 +147,9 @@ x in the event structure coordinates will be screen-relative character-cell
 coordinates.
 The returned state mask will have exactly one bit set to
 indicate the event type.
 coordinates.
 The returned state mask will have exactly one bit set to
 indicate the event type.
+The corresponding data in the queue is marked invalid.
+A subsequent call to \fBgetmouse\fP will retrieve the next older
+item from the queue.
 .PP
 The \fBungetmouse\fR function behaves analogously to \fBungetch\fR.
 It pushes
 .PP
 The \fBungetmouse\fR function behaves analogously to \fBungetch\fR.
 It pushes
@@ -197,7 +198,7 @@ second) that can elapse between press and release events for them to
 be recognized as a click.
 Use \fBmouseinterval(0)\fR to disable click resolution.
 This function returns the previous interval value.
 be recognized as a click.
 Use \fBmouseinterval(0)\fR to disable click resolution.
 This function returns the previous interval value.
-Use \fBmouseinterval(-1)\fR to obtain the interval without altering it.
+Use \fBmouseinterval(\-1)\fR to obtain the interval without altering it.
 The default is one sixth of a second.
 .PP
 The \fBhas_mouse\fP function returns TRUE if the mouse driver has been
 The default is one sixth of a second.
 .PP
 The \fBhas_mouse\fP function returns TRUE if the mouse driver has been
@@ -217,6 +218,7 @@ upon successful completion.
 returns an error.
 If no mouse driver was initialized, or
 if the mask parameter is zero,
 returns an error.
 If no mouse driver was initialized, or
 if the mask parameter is zero,
+it also returns an error if no more events remain in the queue.
 .TP 5
 \fBungetmouse\fP
 returns an error if the FIFO is full.
 .TP 5
 \fBungetmouse\fP
 returns an error if the FIFO is full.
@@ -281,10 +283,17 @@ corresponds to private mode 1000 of xterm:
 .RS
 \\E[?1000%?%p1%{1}%=%th%el%;
 .RE
 .RS
 \\E[?1000%?%p1%{1}%=%th%el%;
 .RE
+.PP
 The z 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 z 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.
+.PP
+The \fBALL_MOUSE_EVENTS\fP class does not include \fBREPORT_MOUSE_POSITION\fP.
+They are distinct.
+For example, in xterm,
+wheel/scrolling mice send position reports as a sequence of
+presses of buttons 4 or 5 without matching button-releases.
 .SH BUGS
 Mouse events under xterm will not in fact be ignored during cooked mode,
 if they have been enabled by \fBmousemask\fR.
 .SH BUGS
 Mouse events under xterm will not in fact be ignored during cooked mode,
 if they have been enabled by \fBmousemask\fR.
@@ -307,10 +316,5 @@ the terminal description, then the terminal may send mouse events.
 .SH SEE ALSO
 \fBcurses\fR(3X),
 \fBcurs_kernel\fR(3X),
 .SH SEE ALSO
 \fBcurses\fR(3X),
 \fBcurs_kernel\fR(3X),
-\fBcurs_slk\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+\fBcurs_slk\fR(3X),
+\fBcurs_variables\fR(3X).