mouse(7) UNIX System V mouse(7)
NAME
mouse - mouse device driver supporting bus, serial, and PS/2 compatible
mouse devices.
DESCRIPTION
The Mouse Driver Package, Version 3.0, device driver supports three types
of mouse devices:
Logitech bus mouse, which attaches to a plug-in card and is
designed to be used in an eight-bit card slot.
Logitech serial type mouse, which plugs directly into a serial
port connector.
PS/2 compatible mouse, which connects to a PS/2 auxiliary port.
The driver will support multiple mouse applications running in virtual
terminal screens, both under the UNIX System and MS-DOS via SimulTask.
Support for a mouse administration is also provided. See mouseadmin(1).
The following ioctl's are supported:
MOUSEIOCMON Used exclusively by /usr/lib/mousemgr to receive
open/close commands from /dev/mouse driver.
MOUSEISOPEN Used exclusively by mouseadmin. Returns 16-byte character
array indicating which mouse devices are currently open; 1
is open, 0 is not open. The array is in the linear order
established by /usr/bin/mouseadmin in building the
display/device map pairs.
MOUSEIOCCONFIG Used exclusively by mouseadmin to configure display/mouse
pairs. The msecfg data structure is used to pass
display/device mapping and map pair count information to
the driver:
struct mse_cfg {
struct mousemap *mapping;
unsigned int count;
}
struct mousemap {
devt dispdev;
devt msedev;
}
MOUSEIOCREAD Read mouse position/status data. The following data
structure is used to return mouse position information to
a user application:
struct mouseinfo {
unsigned char status;
char xmotion:
char ymotion;
10/89 Page 1
mouse(7) UNIX System V mouse(7)
}
MOUSEIOCREAD will set errno to EFAULT for failure to
return a valid mouseinfo structure. The status byte
contains the button state information according to the
following format:
0 Mv Lc Mc Rc L M R
where:
Mv:
is 1 if the mouse has moved since last MOUSEIOCREAD
Lc:
is 1 if Left button has changed state since last
MOUSEIOCREAD
Mc:
is 1 if Middle button has changed state since last
MOUSEIOCREAD
Rc:
is 1 if Right button has changed state since last
MOUSEIOCREAD
L: current state of Left button (1 == depressed)
M: current state of Middle button
R: current state of Right button
The Mv bit is required because the total x and y delta
since the last MOUSEIOCREAD ioctl could be 0 yet the mouse
may have been moved. The Lc, Mc, and Rc bits are required
for a similar reason; if a button had been pushed and
released since the last MOUSEIOCREAD ioctl, the current
state bit would be unchanged but the application would
want to know the button had been pushed.
The xmotion and ymotion fields are signed quantities
relative to the previous position in the range -128 to
127. Deltas that would overflow a signed char have been
truncated.
MOUSE320 Used to send commands and receive responses from the PS/2
compatible mouse devices. Failed MOUSE320 commands will
return ENXIO as the errno value. The following data
structure is used to pass commands/status/position
information between the driver and a user application:
struct cmd_320 {
int cmd;
int arg1;
int arg2;
Page 2 10/89
mouse(7) UNIX System V mouse(7)
int arg3;
}
Legal commands for the PS/2 compatible devices are as
follows:
MSERESET reset mouse
MSERESEND
resend last data
MSESETDEF
set default status
MSEOFF disable mouse
MSEON enable mouse
MSESPROMPT
set prompt mode
MSEECHON set echo mode
MSEECHOFF
reset echo mode
MSESTREAM
set stream mode
MSESETRES
set resolution (counts per millimeter)
legal arg1 values are as follows:
00 = 1 count/mm.
01 = 2 count/mm.
02 = 4 count/mm.
03 = 8 count/mm.
MSESCALE2
set 2:1 scaling
MSESCALE1
set 1:1 scaling
MSECHGMOD
set sampling rate (reports per second)
legal arg1 values are as follows:
0A = 10 reports/sec.
14 = 20 reports/sec.
28 = 40 reports/sec.
3C = 60 reports/sec.
50 = 80 reports/sec.
64 = 100 reports/sec.
C8 = 200 reports/sec.
10/89 Page 3
mouse(7) UNIX System V mouse(7)
MSEGETDEV
read device type returns a zero (0) for the PS/2
compatible mouse.
MSEREPORT
read mouse report returns three-byte mouse/button
position where bytes two and three are 9-bit 2's
complement relative motions with the 9th bit (sign
bit) coming from byte 1.
Byte 1
b0 - left button (1 == depressed)
b1 - right button
b2 - middle button
b3 - always 1
b4 - X data sign (1 == negative)
b5 - Y data sign
b6 - X data overflow
b7 - Y data overflow
Byte 2
X axis position data
Byte 3
Y axis position data
MSESTATREQ
status request returns three-byte report with the
following format:
Byte 1
b0 - right button (1 == depressed)
b1 - middle button
b2 - left button
b3 - always 0
b4 - scaling 1:1 = 0, 2:1 = 1
b5 - disabled(0)/enabled(1)
b6 - stream(0)/prompt(1) mode
b7 - always 0
Byte 2
b0 - 6 current resolution
b7 - always 0
Byte 3
b0 - 7 current sampling rate
NOTE
The Mouse 3.0 device driver is intended for use with UNIX System V
Release 4.0 or later releases. The version 3.0 mouse also supports queue
mode for accessing mouse input, both motion and button events; see
display(7) for more information on KDQUEMODE.
FILES
/dev/mouse
/usr/lib/mousemgr
Page 4 10/89
mouse(7) UNIX System V mouse(7)
/usr/include/sys/mouse.h
SEE ALSO
mouseadmin(1)
Mouse Driver Administrator's Guide
10/89 Page 5