]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man4/mouse.4
prctl.2: Fix alphabetical misplacements in ERRORS
[thirdparty/man-pages.git] / man4 / mouse.4
1 '\" t
2 .\" This manpage is Copyright (C) 1996 Michael Haardt.
3 .\" Updates Nov 1998, Andries Brouwer
4 .\"
5 .\" %%%LICENSE_START(VERBATIM)
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.
14 .\"
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.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" %%%LICENSE_END
26 .TH MOUSE 4 1996-02-10 "Linux" "Linux Programmer's Manual"
27 .SH NAME
28 mouse \- serial mouse interface
29 .SH CONFIGURATION
30 Serial mice are connected to a serial RS232/V24 dialout line, see
31 .BR ttyS (4)
32 for a description.
33 .SH DESCRIPTION
34 .SS Introduction
35 The pinout of the usual 9 pin plug as used for serial mice is:
36 .TS
37 center;
38 r c l.
39 pin name used for
40 2 RX Data
41 3 TX \-12 V, Imax = 10 mA
42 4 DTR +12 V, Imax = 10 mA
43 7 RTS +12 V, Imax = 10 mA
44 5 GND Ground
45 .TE
46
47 This is the specification, in fact 9 V suffices with most mice.
48 .PP
49 The mouse driver can recognize a mouse by dropping RTS to low and raising
50 it again.
51 About 14 ms later the mouse will send 0x4D (\(aqM\(aq) on the data line.
52 After a further 63 ms, a Microsoft-compatible 3-button mouse will send
53 0x33 (\(aq3\(aq).
54 .PP
55 The relative mouse movement is sent as
56 .I dx
57 (positive means right)
58 and
59 .I dy
60 (positive means down).
61 Various mice can operate at different speeds.
62 To select speeds, cycle through the
63 speeds 9600, 4800, 2400, and 1200 bit/s, each time writing the two characters
64 from the table below and waiting 0.1 seconds.
65 The following table shows available speeds and the strings that select them:
66 .TS
67 center;
68 l l.
69 bit/s string
70 9600 *q
71 4800 *p
72 2400 *o
73 1200 *n
74 .TE
75
76 The first byte of a data packet can be used to synchronization purposes.
77 .SS Microsoft protocol
78 The
79 .B Microsoft
80 protocol uses 1 start bit, 7 data bits, no parity
81 and one stop bit at the speed of 1200 bits/sec.
82 Data is sent to RxD in 3-byte packets.
83 The
84 .IR dx
85 and
86 .I dy
87 movements are sent as
88 two's-complement,
89 .I lb
90 .RI ( rb )
91 are set when the left (right)
92 button is pressed:
93 .TS
94 center;
95 r c c c c c c c.
96 byte d6 d5 d4 d3 d2 d1 d0
97 1 1 lb rb dy7 dy6 dx7 dx6
98 2 0 dx5 dx4 dx3 dx2 dx1 dx0
99 3 0 dy5 dy4 dy3 dy2 dy1 dy0
100 .TE
101 .SS 3-button Microsoft protocol
102 Original Microsoft mice only have two buttons.
103 However, there are some
104 three button mice which also use the Microsoft protocol.
105 Pressing or
106 releasing the middle button is reported by sending a packet with zero
107 movement and no buttons pressed.
108 (Thus, unlike for the other two buttons, the status of the middle
109 button is not reported in each packet.)
110 .SS Logitech protocol
111 Logitech serial 3-button mice use a different extension of the
112 Microsoft protocol: when the middle button is up, the above 3-byte
113 packet is sent.
114 When the middle button is down a 4-byte packet is
115 sent, where the 4th byte has value 0x20 (or at least has the 0x20
116 bit set).
117 In particular, a press of the middle button is reported
118 as 0,0,0,0x20 when no other buttons are down.
119 .SS Mousesystems protocol
120 The
121 .B Mousesystems
122 protocol uses 1 start bit, 8 data bits, no parity
123 and two stop bits at the speed of 1200 bits/sec.
124 Data is sent to RxD in
125 5-byte packets.
126 .I dx
127 is sent as the sum of the two two's-complement
128 values,
129 .I dy
130 is send as negated sum of the two two's-complement
131 values.
132 .I lb
133 .RI ( mb ,
134 .IR rb )
135 are cleared when the left (middle,
136 right) button is pressed:
137 .TS
138 center;
139 r c c c c c c c c.
140 byte d7 d6 d5 d4 d3 d2 d1 d0
141 1 1 0 0 0 0 lb mb rb
142 2 0 dxa6 dxa5 dxa4 dxa3 dxa2 dxa1 dxa0
143 3 0 dya6 dya5 dya4 dya3 dya2 dya1 dya0
144 4 0 dxb6 dxb5 dxb4 dxb3 dxb2 dxb1 dxb0
145 5 0 dyb6 dyb5 dyb4 dyb3 dyb2 dyb1 dyb0
146 .TE
147
148 Bytes 4 and 5 describe the change that occurred since bytes 2 and 3
149 were transmitted.
150 .SS Sun protocol
151 The
152 .B Sun
153 protocol is the 3-byte version of the above 5-byte
154 Mousesystems protocol: the last two bytes are not sent.
155 .SS MM protocol
156 The
157 .B MM
158 protocol uses 1 start bit, 8 data bits, odd parity and one
159 stop bit at the speed of 1200 bits/sec.
160 Data is sent to RxD in 3-byte
161 packets.
162 .I dx
163 and
164 .I dy
165 are sent as single signed values, the
166 sign bit indicating a negative value.
167 .I lb
168 .RI ( mb ,
169 .IR rb )
170 are
171 set when the left (middle, right) button is pressed:
172 .TS
173 center;
174 r c c c c c c c c.
175 byte d7 d6 d5 d4 d3 d2 d1 d0
176 1 1 0 0 dxs dys lb mb rb
177 2 0 dx6 dx5 dx4 dx3 dx2 dx1 dx0
178 3 0 dy6 dy5 dy4 dy3 dy2 dy1 dy0
179 .TE
180 .SH FILES
181 .TP
182 .I /dev/mouse
183 A commonly used symlink pointing to a mouse device.
184 .SH SEE ALSO
185 .BR ttyS (4),
186 .BR gpm (8)