]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man4/mouse.4
Various pages: tfix (Oxford comma)
[thirdparty/man-pages.git] / man4 / mouse.4
CommitLineData
fea681da
MK
1.\" This manpage is Copyright (C) 1996 Michael Haardt.
2.\" Updates Nov 1998, Andries Brouwer
3.\"
93015253 4.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
5.\" Permission is granted to make and distribute verbatim copies of this
6.\" manual provided the copyright notice and this permission notice are
7.\" preserved on all copies.
8.\"
9.\" Permission is granted to copy and distribute modified versions of this
10.\" manual under the conditions for verbatim copying, provided that the
11.\" entire resulting derived work is distributed under the terms of a
12.\" permission notice identical to this one.
c13182ef 13.\"
fea681da
MK
14.\" Since the Linux kernel and libraries are constantly changing, this
15.\" manual page may be incorrect or out-of-date. The author(s) assume no
16.\" responsibility for errors or omissions, or for damages resulting from
17.\" the use of the information contained herein. The author(s) may not
18.\" have taken the same level of care in the production of this manual,
19.\" which is licensed free of charge, as they might when working
20.\" professionally.
c13182ef 21.\"
fea681da
MK
22.\" Formatted or processed versions of this manual, if unaccompanied by
23.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 24.\" %%%LICENSE_END
ed6c69ca 25.TH MOUSE 4 2020-08-13 "Linux" "Linux Programmer's Manual"
fea681da
MK
26.SH NAME
27mouse \- serial mouse interface
35490a1f 28.SH CONFIGURATION
fea681da 29Serial mice are connected to a serial RS232/V24 dialout line, see
f82a9fac 30.BR ttyS (4)
fea681da
MK
31for a description.
32.SH DESCRIPTION
33.SS Introduction
34The pinout of the usual 9 pin plug as used for serial mice is:
099f401b 35.PP
fea681da
MK
36.TS
37center;
38r c l.
39pin name used for
402 RX Data
c3074d70 413 TX \-12 V, Imax = 10 mA
fea681da
MK
424 DTR +12 V, Imax = 10 mA
437 RTS +12 V, Imax = 10 mA
445 GND Ground
45.TE
099f401b 46.PP
fea681da
MK
47This is the specification, in fact 9 V suffices with most mice.
48.PP
49The mouse driver can recognize a mouse by dropping RTS to low and raising
c13182ef 50it again.
f81fb444 51About 14 ms later the mouse will send 0x4D (\(aqM\(aq) on the data line.
fea681da 52After a further 63 ms, a Microsoft-compatible 3-button mouse will send
f81fb444 530x33 (\(aq3\(aq).
fea681da 54.PP
35cfd378
MK
55The relative mouse movement is sent as
56.I dx
57(positive means right)
58and
59.I dy
60(positive means down).
c13182ef
MK
61Various mice can operate at different speeds.
62To select speeds, cycle through the
a797afac 63speeds 9600, 4800, 2400, and 1200 bit/s, each time writing the two characters
c13182ef
MK
64from the table below and waiting 0.1 seconds.
65The following table shows available speeds and the strings that select them:
099f401b 66.PP
fea681da
MK
67.TS
68center;
69l l.
70bit/s string
719600 *q
724800 *p
732400 *o
741200 *n
75.TE
099f401b 76.PP
f7e09ea9 77The first byte of a data packet can be used for synchronization purposes.
73d8cece 78.SS Microsoft protocol
35cfd378
MK
79The
80.B Microsoft
81protocol uses 1 start bit, 7 data bits, no parity
c13182ef
MK
82and one stop bit at the speed of 1200 bits/sec.
83Data is sent to RxD in 3-byte packets.
35cfd378 84The
51700fd7 85.IR dx
35cfd378
MK
86and
87.I dy
88movements are sent as
89two's-complement,
90.I lb
91.RI ( rb )
92are set when the left (right)
fea681da 93button is pressed:
099f401b 94.PP
fea681da
MK
95.TS
96center;
97r c c c c c c c.
98byte d6 d5 d4 d3 d2 d1 d0
991 1 lb rb dy7 dy6 dx7 dx6
1002 0 dx5 dx4 dx3 dx2 dx1 dx0
1013 0 dy5 dy4 dy3 dy2 dy1 dy0
102.TE
73d8cece 103.SS 3-button Microsoft protocol
c13182ef
MK
104Original Microsoft mice only have two buttons.
105However, there are some
106three button mice which also use the Microsoft protocol.
107Pressing or
fea681da
MK
108releasing the middle button is reported by sending a packet with zero
109movement and no buttons pressed.
110(Thus, unlike for the other two buttons, the status of the middle
111button is not reported in each packet.)
73d8cece 112.SS Logitech protocol
fea681da
MK
113Logitech serial 3-button mice use a different extension of the
114Microsoft protocol: when the middle button is up, the above 3-byte
c13182ef
MK
115packet is sent.
116When the middle button is down a 4-byte packet is
fea681da 117sent, where the 4th byte has value 0x20 (or at least has the 0x20
c13182ef
MK
118bit set).
119In particular, a press of the middle button is reported
fea681da 120as 0,0,0,0x20 when no other buttons are down.
73d8cece 121.SS Mousesystems protocol
35cfd378
MK
122The
123.B Mousesystems
124protocol uses 1 start bit, 8 data bits, no parity
c13182ef
MK
125and two stop bits at the speed of 1200 bits/sec.
126Data is sent to RxD in
be7fff26 1275-byte packets.
35cfd378
MK
128.I dx
129is sent as the sum of the two two's-complement
130values,
131.I dy
132is send as negated sum of the two two's-complement
be7fff26 133values.
35cfd378
MK
134.I lb
135.RI ( mb ,
136.IR rb )
137are cleared when the left (middle,
fea681da 138right) button is pressed:
099f401b 139.PP
fea681da
MK
140.TS
141center;
142r c c c c c c c c.
143byte d7 d6 d5 d4 d3 d2 d1 d0
1441 1 0 0 0 0 lb mb rb
1452 0 dxa6 dxa5 dxa4 dxa3 dxa2 dxa1 dxa0
1463 0 dya6 dya5 dya4 dya3 dya2 dya1 dya0
1474 0 dxb6 dxb5 dxb4 dxb3 dxb2 dxb1 dxb0
1485 0 dyb6 dyb5 dyb4 dyb3 dyb2 dyb1 dyb0
149.TE
099f401b 150.PP
fea681da
MK
151Bytes 4 and 5 describe the change that occurred since bytes 2 and 3
152were transmitted.
73d8cece 153.SS Sun protocol
35cfd378
MK
154The
155.B Sun
156protocol is the 3-byte version of the above 5-byte
fea681da 157Mousesystems protocol: the last two bytes are not sent.
73d8cece 158.SS MM protocol
35cfd378
MK
159The
160.B MM
3ded684c 161protocol uses 1 start bit, 8 data bits, odd parity, and one
c13182ef
MK
162stop bit at the speed of 1200 bits/sec.
163Data is sent to RxD in 3-byte
be7fff26 164packets.
35cfd378
MK
165.I dx
166and
167.I dy
168are sent as single signed values, the
c13182ef 169sign bit indicating a negative value.
35cfd378
MK
170.I lb
171.RI ( mb ,
172.IR rb )
173are
fea681da 174set when the left (middle, right) button is pressed:
099f401b 175.PP
fea681da
MK
176.TS
177center;
178r c c c c c c c c.
179byte d7 d6 d5 d4 d3 d2 d1 d0
1801 1 0 0 dxs dys lb mb rb
1812 0 dx6 dx5 dx4 dx3 dx2 dx1 dx0
1823 0 dy6 dy5 dy4 dy3 dy2 dy1 dy0
183.TE
fea681da
MK
184.SH FILES
185.TP
186.I /dev/mouse
e722b67c 187A commonly used symbolic link pointing to a mouse device.
47297adb 188.SH SEE ALSO
f82a9fac 189.BR ttyS (4),
fea681da 190.BR gpm (8)