Files
plan9port/man/man3/mousescrollsize.3
Dmitri Vereshchagin 10564b1175 tmac/tmac.an: define .MR in a groff compatible way
groff 1.23.0 added .MR to its -man macro package.  The NEWS file states
that the inclusion of the macro "was prompted by its introduction to
Plan 9 from User Space's troff in August 2020."  From d32deab it seems
that the name for Plan 9 from User Space's implementation was suggested
by groff maintainer G. Brandon Robinson.

Not sure if the intention was to make these definitions compatible, but
it would be nice if they were.

Currently, Plan 9 from User Space's .MR expects its second argument to
be parenthesized.  groff's .MR does not.  This results in extra
parentheses appearing in manual references when viewing Plan 9 from User
Space's manual pages on a system using groff.
2025-07-27 09:58:50 -04:00

63 lines
1.5 KiB
Groff

.TH MOUSESCROLLSIZE 3
.SH NAME
mousescrollsize \- compute mouse scroll increment
.SH SYNOPSIS
.B #include <draw.h>
.PP
int mousescrollsize(int maxlines)
.SH DESCRIPTION
.I Mousescrollsize
computes the number of lines of text that should be scrolled
in response to a mouse scroll wheel click.
.I Maxlines
is the number of lines visible in the text window.
.PP
The default scroll increment is one line.
This default can be overridden by setting the
.B $mousescrollsize
environment variable to an integer, which specifies
a constant number of lines, or to a real number
followed by a percent character, indicating that the
scroll increment should be a percentage of the total
number of lines in the window.
For example, setting
.B $mousescrollsize
to
.B 50%
causes a half-window scroll increment.
.PP
.I Mousescrollsize
is used by
.MR 9term 1
and
.MR acme 1
to set their scrolling behavior.
.SH SOURCE
.B \*9/src/libdraw/scroll.c
.SH SEE ALSO
.MR 9term 1 ,
.MR acme 1
.SH BUGS
.I Libdraw
expects up and down scroll wheel events to be expressed as clicks of mouse buttons 4 and 5,
but the XFree86 default is to ignore the scroll wheel.
To enable the scroll wheel, change your
.B InputDevice
section of
.B XF86Config-4
to look like:
.IP
.EX
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Device" "/dev/psaux"
# next four lines enable scroll wheel as buttons 4 and 5
Option "Buttons" "5"
Option "Emulate3Buttons" "off"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
EndSection
.EE