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