]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man4/mouse.4
Import of man-pages 1.70
[thirdparty/man-pages.git] / man4 / mouse.4
1 '\" t
2 .\"roff.\" Copyright
3 .\" This manpage is Copyright (C) 1996 Michael Haardt.
4 .\" Updates Nov 1998, Andries Brouwer
5 .\"
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 .TH MOUSE 4 1996-02-10 "Special files" "Linux Programmer's Manual"
26 .SH NAME
27 mouse \- serial mouse interface
28 .SH CONFIG
29 Serial mice are connected to a serial RS232/V24 dialout line, see
30 .BR ttys (4)
31 for a description.
32 .SH DESCRIPTION
33 .SS Introduction
34 The pinout of the usual 9 pin plug as used for serial mice is:
35
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. About 14 ms later the mouse will send 0x4D ('M') on the data line.
51 After a further 63 ms, a Microsoft-compatible 3-button mouse will send
52 0x33 ('3').
53 .PP
54 The relative mouse movement is sent as \fIdx\fP (positive means right)
55 and \fIdy\fP (positive means down). Various mice can operate at different
56 speeds. To select speeds, cycle through the
57 speeds 9600, 4800, 2400 and 1200 bit/s, each time writing the two characters
58 from the table below and waiting 0.1 seconds. The following table shows
59 available speeds and the strings that select them:
60
61 .TS
62 center;
63 l l.
64 bit/s string
65 9600 *q
66 4800 *p
67 2400 *o
68 1200 *n
69 .TE
70
71 The first byte of a data packet can be used to synchronisation purposes.
72 .SS "Microsoft protocol"
73 The \fBMicrosoft\fP protocol uses 1 start bit, 7 data bits, no parity
74 and one stop bit at the speed of 1200 bits/sec. Data is sent to RxD in
75 3-byte packets. The \fIdx\fP and \fIdy\fP movements are sent as
76 two's-complement, \fIlb\fP (\fIrb\fP) are set when the left (right)
77 button is pressed:
78
79 .TS
80 center;
81 r c c c c c c c.
82 byte d6 d5 d4 d3 d2 d1 d0
83 1 1 lb rb dy7 dy6 dx7 dx6
84 2 0 dx5 dx4 dx3 dx2 dx1 dx0
85 3 0 dy5 dy4 dy3 dy2 dy1 dy0
86 .TE
87 .SS "3-button Microsoft protocol"
88 Original Microsoft mice only have two buttons. However, there are some
89 three button mice which also use the Microsoft protocol. Pressing or
90 releasing the middle button is reported by sending a packet with zero
91 movement and no buttons pressed.
92 (Thus, unlike for the other two buttons, the status of the middle
93 button is not reported in each packet.)
94 .SS "Logitech protocol"
95 Logitech serial 3-button mice use a different extension of the
96 Microsoft protocol: when the middle button is up, the above 3-byte
97 packet is sent. When the middle button is down a 4-byte packet is
98 sent, where the 4th byte has value 0x20 (or at least has the 0x20
99 bit set). 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 \fBMousesystems\fP protocol uses 1 start bit, 8 data bits, no parity
103 and two stop bits at the speed of 1200 bits/sec. Data is sent to RxD in
104 5-byte packets. \fIdx\fP is sent as the sum of the two two's-complement
105 values, \fIdy\fP is send as negated sum of the two two's-complement
106 values. \fIlb\fP (\fImb\fP, \fIrb\fP) are cleared when the left (middle,
107 right) button is pressed:
108
109 .TS
110 center;
111 r c c c c c c c c.
112 byte d7 d6 d5 d4 d3 d2 d1 d0
113 1 1 0 0 0 0 lb mb rb
114 2 0 dxa6 dxa5 dxa4 dxa3 dxa2 dxa1 dxa0
115 3 0 dya6 dya5 dya4 dya3 dya2 dya1 dya0
116 4 0 dxb6 dxb5 dxb4 dxb3 dxb2 dxb1 dxb0
117 5 0 dyb6 dyb5 dyb4 dyb3 dyb2 dyb1 dyb0
118 .TE
119
120 Bytes 4 and 5 describe the change that occurred since bytes 2 and 3
121 were transmitted.
122 .SS "Sun protocol"
123 The \fBSun\fP protocol is the 3-byte version of the above 5-byte
124 Mousesystems protocol: the last two bytes are not sent.
125 .SS "MM protocol"
126 The \fBMM\fP protocol uses 1 start bit, 8 data bits, odd parity and one
127 stop bit at the speed of 1200 bits/sec. Data is sent to RxD in 3-byte
128 packets. \fIdx\fP and \fIdy\fP are sent as single signed values, the
129 sign bit indicating a negative value. \fIlb\fP (\fImb\fP, \fIrb\fP) are
130 set when the left (middle, right) button is pressed:
131
132 .TS
133 center;
134 r c c c c c c c c.
135 byte d7 d6 d5 d4 d3 d2 d1 d0
136 1 1 0 0 dxs dys lb mb rb
137 2 0 dx6 dx5 dx4 dx3 dx2 dx1 dx0
138 3 0 dy6 dy5 dy4 dy3 dy2 dy1 dy0
139 .TE
140
141 .SH FILES
142 .TP
143 .I /dev/mouse
144 A commonly used symlink pointing to a mouse device.
145
146 .SH "SEE ALSO"
147 .BR ttys (4),
148 .BR gpm (8)