X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;ds=sidebyside;f=man%2Fcurs_mouse.3x;h=0a75065f1ec906f05c034846a943389daf7b13c1;hb=4ec5af5be84fa04621664e4f6f1235c12dc1ce88;hp=01dc68297623c14ba4c0213820cb0131fcc89473;hpb=96d6b16de0d487e5d3aed0302a179dbce11b5d96;p=ncurses.git diff --git a/man/curs_mouse.3x b/man/curs_mouse.3x index 01dc6829..0a75065f 100644 --- a/man/curs_mouse.3x +++ b/man/curs_mouse.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2014,2015 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 * @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_mouse.3x,v 1.38 2010/12/04 18:38:55 tom Exp $ +.\" $Id: curs_mouse.3x,v 1.41 2015/04/11 10:23:49 tom Exp $ .TH curs_mouse 3X "" .na .hy 0 @@ -40,20 +40,18 @@ .ad .hy .SH SYNOPSIS -.nf -\fB#include +\fB#include \fR .PP -\fBtypedef unsigned long mmask_t; +\fBtypedef unsigned long mmask_t;\fR .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 -.br +.PP \fBbool has_mouse(void);\fR .br \fBint getmouse(MEVENT *event);\fR @@ -137,7 +135,7 @@ REPORT_MOUSE_POSITION report mouse movement _ .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 @@ -159,8 +157,8 @@ a \fBKEY_MOUSE\fR event onto the input queue, and associates with that event the given state data and screen-relative character-cell coordinates. .PP The \fBwenclose\fR function tests whether a given pair of screen-relative -character-cell coordinates is enclosed by a given window, returning TRUE -if it is and FALSE otherwise. +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. .PP @@ -203,7 +201,7 @@ This function returns the previous interval value. 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 \fBhas_mouse\fP function returns \fBTRUE\fP if the mouse driver has been successfully initialized. .PP Note that mouse events will be ignored when input is in cooked mode, and will @@ -285,10 +283,17 @@ corresponds to private mode 1000 of xterm: .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. +.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.