MOUSE(4)

NAME
mouse - mouse interface

SYNOPSIS
pseudo-device ms

DESCRIPTION
The mouse driver provides a low-level interface to the mouse for the IBM RT PC. A tty(4)-like interface is provided, in that the kernel uses internal tty protocols for buffering data to read data from the interface. Thus, the system calls select(2) and fcntl(2) relating to non-blocking I/O may be used. Commands are issued to the mouse through the standard ioctl(2) mechanism, although none of the terminal-specific ioctls apply and that the mouse is always in ``mouse-discipline'' mode.

The mouse can only be opened by one process at a time; subsequent processes will receive ENXIO in response to open(2) calls.

  Data
The data structures necessary for communicating with the mouse are provided in <machineio/mouseio.h>. This file also includes macros for interpreting the mouse stream data, and symbolic names for the commands the mouse understands.

Since many applications expect a three-button mouse, a three-button mouse is simulated by indicating a middle button when both buttons are depressed. This means that an application program will never see a data report indicating that both buttons are pressed. There is a small delay in recognizing a single button, in order to allow smooth recognition of both buttons, since one cannot always press both buttons at exactly the same time. In addition, a single button from a middle (double-button) transition will not be reported until both buttons have been released and then the single button pressed.

  Commands
The commands available to the user through ioctls are defined in <machineio/mouseio.h> and described below. When in stream mode, the driver will disable the mouse before issuing commands which expect responses.

MSIC_STREAM
    Sets the mouse in stream mode which, when enabled, sends unsolicited data reports. This is the default after the mouse has been opened.

MSIC_REMOTE
    Sets the mouse to remote mode, where it will send data reports only in response to a MSIC_READXY command; no unsolicited data will be sent.

MSIC_STATUS
    The current mouse status data report, as defined in <machineio/mouseio.h>, will be placed in the passed four-byte character pointer. Note that the status report contains the true state of the buttons; a middle button is not simulated.

MSIC_READXY
    This will solicit a data report from the mouse even if it hasn't been moved or button conditions have not changed. MSIC_READXY can be used in either stream or remote mode. In stream mode, the driver will disable the mouse before performing the read.

MSIC_ENABLE
    Enable the mouse to send unsolicited data reports in stream mode. This is the default after the mouse has been opened.

MSIC_DISABLE
    Prohibits the mouse from sending unsolicited data reports in stream mode.

MSIC_EXP
    An exponential transform is applied to data reported by the mouse, as follows:

    Let xn(98 be the number of counts accumulated in the sample interval. Let xn(98 be the number of counts accumulated in the sample interval.The value r where

            This scaling applies only to mouse-generated reports. Reports generated in response to MSIC_READXY are always linear.

        MSIC_LINEAR
            Set the mouse back to linear scaling, where the value reported is the number of counts. This is the default after the mouse has been opened.

        MSIC_SAMP
            Set the mouse sampling rate. The argument passed in the ioctl must contain the desired sampling reate in counts per second. Legal values are 10, 20, 40, 60, 80 and 100. These are provided in <machineio/mouseio.h> as MS_RATE_10, MS_RATE_20, ..., MS_RATE_100 respectively. The default after the mouse has been opened is MS_RATE_100.

        MSIC_RESL
            Set the mouse resolution. The argument passed must contain the the required resolution in counts per inch. Legal resolutions are 25, 50, 100, 200. These are provided in <machineio/mouseio.h> as MS_RES_25, MS_RES_50, MS_RES_100, MS_RES_200, respectively. The default after the mouse has been opened is MS_RES_100.

FILES
/dev/mouse

SEE ALSO
tty(4), select(2)
IBM RT PC Technical Reference Manual, ``Adapter'', section 3.1.4
IBM RT PC Technical Reference Manual, ``Mouse'', section 6.2