Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ mouse(4) — AOS 4.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

select(2)

tty(4)

tb(4)

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 or IBM 6152 Academic System.  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.

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. This is only valid if the mouse line discipline MSLINEDISC (defined in <machineio/mouseio.h>) is used. 

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.  Not supported for IBM 6152 Academic System. 

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.  Not supported for IBM 6152 Academic System. 

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
For the IBM RT/PC, an exponential transform is applied to data reported by the mouse, as follows:

Letx be the number of counts accumulated in the sample interval.  The value reported will besign(x)·(2N) where

N=abs(x)·rate over resolution − 3.

 

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

For the IBM 6152 Academic System, MSCI_EXP exchanges the scaling factor applied to mouse-generated reports from linear (a:T) to 2:1:

Let x be the number of counts accumulated in the sample interval.  The value reported will be 2x. 

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. 

The mouse data stream follows to console input focus (see cons(4)).  There are seven mouse devices, one generic mouse (/dev/mouse) and one for each supported display (/dev/msxxx).  If the generic mouse is opened, it takes input from the current input focus.  The last four bits of the minor device decide which mouse data stream the process reads (0 = generic mouse).  The upper four bits select the default line discipline used by the mouse. 

FILES

For the IBM RT/PC:
/dev/mouse
/dev/msaed
/dev/msapa16
/dev/msapa8c
/dev/msapa8
/dev/msega
/dev/msmono
/dev/msmpel

For the IBM 6152 Academic System:
/dev/mouse
/dev/msvga
/dev/ms8514

SEE ALSO

select(2), tty(4), tb(4)

For the IBM RT/PC:
IBM RT PC Hardware Technical Reference Manual, “Keyboard, Locator, Speaker Adapter”, section 5, SV21-8021

PRPQs 5799-WZQ/5799-PFF: IBM/4.3  —  Dec 1987

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026