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