WSMOUSE(4)

πŸ“¦
version 11.0 Β· 2 versions
, in nixpkgs unstable

🐭 WSMOUSE(4) β€” generic mouse support in wscons 🐭

This page lives in the Kernel Interfaces Manual, bestie, and it’s here to explain the generic mouse setup in wscons. No cap, it’s lowkey iconic.

🌸 NAME 🌸

wsmouse β€” generic mouse support in wscons

✨ SYNOPSIS ✨

wsmouse*   at pms? mux 0
(PS/2 mouse, including ``IntelliMouse''-compatible wheel mice)
wsmouse*   at ums? mux 0
(USB mouse)
wsmouse*   at uts? mux 0
(USB touchscreen)
wsmouse*   at lms? mux 0
(Logitech bus mouse, i386 only)
wsmouse*   at mms? mux 0
(Microsoft InPort mouse, i386 only)
wsmouse0   at ams? mux 0
(Apple ADB mouse)
wsmouse*  at btms? mux 0
(Bluetooth mouse)
wsmouse*   at lkms? mux 0
(DEC VSXXX serial mice)

πŸ¦‹ DESCRIPTION πŸ¦‹

The wsmouse driver is the mouse abstraction layer inside the wscons(4) framework. It attaches to the hardware-specific mouse drivers and gives you a character device interface that returns struct wscons_event via read(2). For use with X servers, β€œmouse events” can be generated. Slay.

The wsconsctl(8) utility gives access to several configurable details that affect this driver. Very β€œlet me tweak my setup” of it.

πŸŽ€ Ioctls πŸŽ€

The following ioctl(2) calls are provided by the wsmouse driver or by devices which use it. Their definitions are found in dev/wscons/wsconsio.h.

  • WSMOUSEIO_GETPARAMS (struct wsmouse_parameters) β€” grab mouse parameters.
  • WSMOUSEIO_SETPARAMS (struct wsmouse_parameters) β€” set mouse parameters.

These obtain and set various mouse parameters as a key/value set. Currently these primarily relate to touchpads. The structure struct wsmouse_parameters is defined as follows:

struct wsmouse_param {
        enum wsmousecfg key;
        int value;
};

struct wsmouse_parameters {
        struct wsmouse_param *params;
        unsigned int nparams;
};

The number of parameters to read or write must be specified in nparams. For each parameter, when WSMOUSEIO_GETPARAMS is used, a key must be specified. When WSMOUSEIO_SETPARAMS is used, a key and a value must be specified. A single ioctl may retrieve up to WSMOUSECFG_MAX nparams. Okay periodt, that’s the rules πŸ’…

  • WSMOUSEIO_GETREPEAT (struct wsmouse_repeat) β€” retrieve the current automatic button repeating configuration.

The structure returned is as follows:

struct wsmouse_repeat {
        unsigned long   wr_buttons;
        unsigned int    wr_delay_first;
        unsigned int    wr_delay_decrement;
        unsigned int    wr_delay_minimum;
};

The wr_buttons field is a bit mask that specifies which buttons send press and release events periodically while they are physically held down. The least significant bit corresponds to button 0. Bestie, button 0 is main character here.

The other three fields describe the frequency upon which these automatic events are sent. wr_delay_first specifies the milliseconds before the first repeated event is sent. wr_delay_decrement is used to calculate the delay between the most recently generated event and the forthcoming one: the previous delay is taken and it is decreased by the value given in this variable. wr_delay_minimum specifies the minimum delay, in milliseconds, between two consecutive events.

  • WSMOUSEIO_SETREPEAT (struct wsmouse_repeat) β€” set the automatic button repeating configuration.

See WSMOUSEIO_GETREPEAT above for more details.

  • WSMOUSEIO_SETVERSION (int) β€” set the wscons_event protocol version.

The default is 0 for binary compatibility. The latest version is always available as WSMOUSE_EVENT_VERSION, and is currently 1. All new code should use a call similar to the below to ensure the correct version is returned.

int ver = WSMOUSE_EVENT_VERSION;
if (ioctl(fd, WSMOUSEIO_SETVERSION, &ver) == -1)
    err(EXIT_FAILURE, "cannot set version");

πŸ’– FILES πŸ’–

  • /dev/wsmouse*
  • /usr/include/dev/wscons/wsconsio.h

🌈 SEE ALSO 🌈

btms(4), dreamcast/mms(4), i386/lms(4), i386/mms(4), pms(4), uep(4), ums(4), uts(4), wscons(4), wsmux(4), moused(8), wsconsctl(8), wsmoused(8), wsmouse(9)


xoxo, this page is from Debian, dated September 25, 2021, and it’s the WSMOUSE(4) manual β€” mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from
  • nixpkgs unstable: netbsd-source 11.0
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms