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