]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man4/mouse.4
man.7: Replace page with `so` of groff_man(7)
[thirdparty/man-pages.git] / man4 / mouse.4
CommitLineData
a1eaacb1 1'\" t
fea681da
MK
2.\" This manpage is Copyright (C) 1996 Michael Haardt.
3.\" Updates Nov 1998, Andries Brouwer
4.\"
5fbde956 5.\" SPDX-License-Identifier: Linux-man-pages-copyleft
4c1c5274 6.TH mouse 4 (date) "Linux man-pages (unreleased)"
fea681da
MK
7.SH NAME
8mouse \- serial mouse interface
35490a1f 9.SH CONFIGURATION
fea681da 10Serial mice are connected to a serial RS232/V24 dialout line, see
f82a9fac 11.BR ttyS (4)
fea681da
MK
12for a description.
13.SH DESCRIPTION
14.SS Introduction
15The pinout of the usual 9 pin plug as used for serial mice is:
099f401b 16.PP
fea681da
MK
17.TS
18center;
19r c l.
20pin name used for
212 RX Data
c3074d70 223 TX \-12 V, Imax = 10 mA
fea681da
MK
234 DTR +12 V, Imax = 10 mA
247 RTS +12 V, Imax = 10 mA
255 GND Ground
26.TE
099f401b 27.PP
fea681da
MK
28This is the specification, in fact 9 V suffices with most mice.
29.PP
30The mouse driver can recognize a mouse by dropping RTS to low and raising
c13182ef 31it again.
b957f81f 32About 14 ms later the mouse will send 0x4D (\[aq]M\[aq]) on the data line.
fea681da 33After a further 63 ms, a Microsoft-compatible 3-button mouse will send
b957f81f 340x33 (\[aq]3\[aq]).
fea681da 35.PP
35cfd378
MK
36The relative mouse movement is sent as
37.I dx
38(positive means right)
39and
40.I dy
41(positive means down).
c13182ef
MK
42Various mice can operate at different speeds.
43To select speeds, cycle through the
a797afac 44speeds 9600, 4800, 2400, and 1200 bit/s, each time writing the two characters
c13182ef
MK
45from the table below and waiting 0.1 seconds.
46The following table shows available speeds and the strings that select them:
099f401b 47.PP
fea681da
MK
48.TS
49center;
50l l.
51bit/s string
529600 *q
534800 *p
542400 *o
551200 *n
56.TE
099f401b 57.PP
f7e09ea9 58The first byte of a data packet can be used for synchronization purposes.
73d8cece 59.SS Microsoft protocol
35cfd378
MK
60The
61.B Microsoft
62protocol uses 1 start bit, 7 data bits, no parity
c13182ef
MK
63and one stop bit at the speed of 1200 bits/sec.
64Data is sent to RxD in 3-byte packets.
35cfd378 65The
1ae6b2c7 66.I dx
35cfd378
MK
67and
68.I dy
69movements are sent as
70two's-complement,
71.I lb
72.RI ( rb )
73are set when the left (right)
fea681da 74button is pressed:
099f401b 75.PP
fea681da
MK
76.TS
77center;
78r c c c c c c c.
79byte d6 d5 d4 d3 d2 d1 d0
801 1 lb rb dy7 dy6 dx7 dx6
812 0 dx5 dx4 dx3 dx2 dx1 dx0
823 0 dy5 dy4 dy3 dy2 dy1 dy0
83.TE
73d8cece 84.SS 3-button Microsoft protocol
c13182ef
MK
85Original Microsoft mice only have two buttons.
86However, there are some
87three button mice which also use the Microsoft protocol.
88Pressing or
fea681da
MK
89releasing the middle button is reported by sending a packet with zero
90movement and no buttons pressed.
91(Thus, unlike for the other two buttons, the status of the middle
92button is not reported in each packet.)
73d8cece 93.SS Logitech protocol
fea681da
MK
94Logitech serial 3-button mice use a different extension of the
95Microsoft protocol: when the middle button is up, the above 3-byte
c13182ef
MK
96packet is sent.
97When the middle button is down a 4-byte packet is
fea681da 98sent, where the 4th byte has value 0x20 (or at least has the 0x20
c13182ef
MK
99bit set).
100In particular, a press of the middle button is reported
fea681da 101as 0,0,0,0x20 when no other buttons are down.
73d8cece 102.SS Mousesystems protocol
35cfd378
MK
103The
104.B Mousesystems
3d81c05a 105protocol uses 1 start bit, 8 data bits, no parity,
c13182ef
MK
106and two stop bits at the speed of 1200 bits/sec.
107Data is sent to RxD in
be7fff26 1085-byte packets.
35cfd378
MK
109.I dx
110is sent as the sum of the two two's-complement
111values,
112.I dy
113is send as negated sum of the two two's-complement
be7fff26 114values.
35cfd378
MK
115.I lb
116.RI ( mb ,
117.IR rb )
118are cleared when the left (middle,
fea681da 119right) button is pressed:
099f401b 120.PP
fea681da
MK
121.TS
122center;
123r c c c c c c c c.
124byte d7 d6 d5 d4 d3 d2 d1 d0
1251 1 0 0 0 0 lb mb rb
1262 0 dxa6 dxa5 dxa4 dxa3 dxa2 dxa1 dxa0
1273 0 dya6 dya5 dya4 dya3 dya2 dya1 dya0
1284 0 dxb6 dxb5 dxb4 dxb3 dxb2 dxb1 dxb0
1295 0 dyb6 dyb5 dyb4 dyb3 dyb2 dyb1 dyb0
130.TE
099f401b 131.PP
fea681da
MK
132Bytes 4 and 5 describe the change that occurred since bytes 2 and 3
133were transmitted.
73d8cece 134.SS Sun protocol
35cfd378
MK
135The
136.B Sun
137protocol is the 3-byte version of the above 5-byte
fea681da 138Mousesystems protocol: the last two bytes are not sent.
73d8cece 139.SS MM protocol
35cfd378
MK
140The
141.B MM
3ded684c 142protocol uses 1 start bit, 8 data bits, odd parity, and one
c13182ef
MK
143stop bit at the speed of 1200 bits/sec.
144Data is sent to RxD in 3-byte
be7fff26 145packets.
35cfd378
MK
146.I dx
147and
148.I dy
149are sent as single signed values, the
c13182ef 150sign bit indicating a negative value.
35cfd378
MK
151.I lb
152.RI ( mb ,
153.IR rb )
154are
fea681da 155set when the left (middle, right) button is pressed:
099f401b 156.PP
fea681da
MK
157.TS
158center;
159r c c c c c c c c.
160byte d7 d6 d5 d4 d3 d2 d1 d0
1611 1 0 0 dxs dys lb mb rb
1622 0 dx6 dx5 dx4 dx3 dx2 dx1 dx0
1633 0 dy6 dy5 dy4 dy3 dy2 dy1 dy0
164.TE
fea681da
MK
165.SH FILES
166.TP
167.I /dev/mouse
e722b67c 168A commonly used symbolic link pointing to a mouse device.
47297adb 169.SH SEE ALSO
f82a9fac 170.BR ttyS (4),
fea681da 171.BR gpm (8)