busmouse(4)

NAME
busmouse - Busmouse protocol

SYNOPSIS
#include <machine/mouse.h>

DESCRIPTION
Many mouse drivers internally convert the protocol the mouse uses natively to a common busmouse protocol.

The drivers allow information to be retrieved from the driver using an ioctl(2) call or by reading the device directly using read(2).

The MOUSEIOCREAD ioctl(2) is defined in the header <machine/mouse.h>. It returns a struct mouseinfo.

When reading the mouse device directly, each change of button state or mouse movement generates a five byte event. The bytes contain:
1   Button status. (u_char)
2   Right/left movement. Positive values indicate right, negative left. (char)
3   Up/down movement. Positive values indicate up, negative down. (char)
4   Reserved. Should be zero. (char)
5   Reserved. Should be zero. (char)

The direction bytes are signed characters, giving a range of +127 to -127. A positive value indicates movement to the right or up, and a negative value movement left or down.

SEE ALSO
ioctl(2), read(2), lms(4), mms(4), pms(4).