MOUSESCROLLSIZE(3)

πŸ“¦ version 0_git20260208, in alpine 3.24, arch rolling, nixos 26.05, nixpkgs unstable

✨ NAME ✨

mousescrollsize(3) β€” compute mouse scroll increment. She's from the Library Functions Manual, and she is literally here to make your scroll wheel make sense, bestie. πŸŽ€

🌸 SYNOPSIS 🌸

#include <draw.h>

int  mousescrollsize(int maxlines)

πŸ’… DESCRIPTION πŸ’…

okay so mousescrollsize computes the number of lines of text that should be scrolled in response to a mouse scroll wheel click. maxlines is the number of lines visible in the text window. πŸ‘‘

The default scroll increment is one line. You can override this default by setting the $mousescrollsize environment variable to:

  • an integer, which specifies a constant number of lines; or
  • a real number followed by a percent character, which says the scroll increment should be a percentage of the total number of lines in the window.

For example, setting $mousescrollsize to 50% causes a half-window scroll increment. πŸ¦‹

mousescrollsize is used by 9term(1) and acme(1) to set their scrolling behavior. slay.

πŸ¦‹ SOURCE πŸ¦‹

The source is at /src/libdraw/scroll.c β€” iconic, no cap. ✨

πŸŽ€ SEE ALSO πŸŽ€

πŸ’€ BUGS πŸ’€

Okay bestie, warning time: 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. not the scroll wheel erasure 😭 To enable the scroll wheel, change your InputDevice section of XF86Config-4 to look like:

              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

that's the whole page, bestie πŸ’œ β€” from the Library Functions Manual, page MOUSESCROLLSIZE(3), source /src/libdraw/scroll.c. The footer doesn't print a date here, so I'm not inventing one, periodt. 🫢