3 .\" This manpage is Copyright (C) 1996 Michael Haardt.
4 .\" Updates Nov 1998, Andries Brouwer
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.
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.
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
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
26 .\" Japanese Version Copyright (c) 1996,1997,1998
27 .\" ISHIKAWA Mutsumi,TAKAHASHI Mutsuji
28 .\" all rights reserved.
29 .\" Translated Tue Feb 14 00:47:44 JST 1997
30 .\" by ISHIKAWA Mutsumi <ishikawa@linux.or.jp.jp>
31 .\" and TAKAHASHI Mutsuji <muz@ilp.iijnet.or.jp>
33 .\" Japanese Version Last Modified Sun Jan 11 03:55:54 1998
34 .\" by ISHIKAWA Mutsumi <ishikawa@linux.or.jp>
35 .\" Updated & Modefied Sat Feb 27 1999 by Shouichi Saito
37 .\" WORD: serial mouse ¥·¥ê¥¢¥ë¥Þ¥¦¥¹
38 .\" WORD: interface ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹
39 .\" WORD: RS232/V24 RS232/V24
40 .\" WORD: dialout line ¥À¥¤¥¢¥ë¥¢¥¦¥È¥é¥¤¥ó
41 .\" WORD: pinout ¥Ô¥óÇÛÎó
42 .\" WORD: Microsoft-compatible ¥Þ¥¤¥¯¥í¥½¥Õ¥È¸ß´¹
44 .TH MOUSE 4 1996-02-10 "Linux" "Linux Programmer's Manual"
46 .\"O mouse \- serial mouse interface
48 mouse \- ¥·¥ê¥¢¥ë¥Þ¥¦¥¹¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹
49 .\"O .SH CONFIGURATION
51 .\"O Serial mice are connected to a serial RS232/V24 dialout line, see
53 .\"O for a description.
54 ¥·¥ê¥¢¥ë¥Þ¥¦¥¹¤Ï RS232/V24 ¥À¥¤¥¢¥ë¥¢¥¦¥È¥é¥¤¥ó¤ËÀܳ¤µ¤ì¤ë¡£
55 RS232/V24 ¥À¥¤¥¢¥ë¥¢¥¦¥È¥é¥¤¥ó ¤Ë¤Ä¤¤¤Æ¤Ï
62 .\"O The pinout of the usual 9 pin plug as used for serial mice is:
63 ¥·¥ê¥¢¥ë¥Þ¥¦¥¹¤Ç»È¤ï¤ì¤ëÉáÄ̤Π9 ¥Ô¥ó¥×¥é¥°¤Î¥Ô¥óÇÛÎó¤Ï°Ê²¼¤Ç¤¢¤ë:
69 3 TX -12 V, Imax = 10 mA
70 4 DTR +12 V, Imax = 10 mA
71 7 RTS +12 V, Imax = 10 mA
75 .\"O This is the specification, in fact 9 V suffices with most mice.
76 ¤³¤ì¤Ï»ÅÍͽñ¤Ç¤¢¤ê¡¢¼ÂºÝ¤Ï¤Û¤È¤ó¤É¤Î¥Þ¥¦¥¹¤Ç¤Ï 9 V ¤Ç½½Ê¬¤Ç¤¢¤ë¡£
78 .\"O The mouse driver can recognize a mouse by dropping RTS to low and raising
80 .\"O About 14 ms later the mouse will send 0x4D (\(aqM\(aq) on the data line.
81 .\"O After a further 63 ms, a Microsoft-compatible 3-button mouse will send
82 .\"O 0x33 (\(aq3\(aq).
83 ¥Þ¥¦¥¹¥É¥é¥¤¥Ð¤Ï RTS ¤ò¥í¡¼(low)¤ËÍ¡¢ºÆ¤Ó¾å¤²¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢¥Þ¥¦¥¹¤òǧ¼±¤Ç¤
84 ¤ë¡£¤ª¤è¤½ 14 ms ¸å¡¢¥Þ¥¦¥¹¤Ï¥Ç¡¼¥¿¥é¥¤¥ó¾å¤Ë 0x4D (\(aqM\(aq) ¤òÁ÷¤ë¤À¤í¤¦¡£¤µ¤é
85 ¤Ë 63ms ¤¢¤È¡¢¥Þ¥¤¥¯¥í¥½¥Õ¥È¸ß´¹ 3¥Ü¥¿¥ó¥Þ¥¦¥¹¤Ï 0x33 (\(aq3\(aq) ¤òÁ÷¤ë¡£
87 .\"O The relative mouse movement is sent as \fIdx\fP (positive means right)
88 .\"O and \fIdy\fP (positive means down).
89 .\"O Various mice can operate at different speeds.
90 .\"O To select speeds, cycle through the
91 .\"O speeds 9600, 4800, 2400 and 1200 bit/s, each time writing the two characters
92 .\"O from the table below and waiting 0.1 seconds.
93 .\"O The following table shows available speeds and the strings that select them:
94 ¥Þ¥¦¥¹¤ÎÁêÂÐŪ¤Ê°ÜÆ°¤Ï¡¢\fIdx\fP(Àµ¤¬±¦)¤È\fIdy\fP(Àµ¤¬²¼)¤È¤·¤ÆÅÁ¤¨¤é¤ì¤ë¡£
95 ³Æ¼ï¤Î¥Þ¥¦¥¹¤Ï°Û¤Ê¤Ã¤¿¥¹¥Ô¡¼¥É¤ÇÁàºî¤Ç¤¤ë¡£¥¹¥Ô¡¼¥É¤òÁªÂò¤¹¤ë¤Ë¤Ï¡¢
96 ²¼¤Îɽ¤Î£²Ê¸»ú¤òÁ÷¤Ã¤Æ¤«¤é 0.1 ÉÃÂԤĤ³¤È¤Ç¡¢9600, 4800, 2400, 1200
98 °Ê²¼¤Îɽ¤Ç¤ÏÁªÂò²Äǽ¤Ê¥¹¥Ô¡¼¥É¤È¤½¤ì¤òÁªÂò¤¹¤ë¤¿¤á¤Îʸ»úÎó¤ò¼¨¤·¤Æ¤¤¤ë¡£
109 .\"O The first byte of a data packet can be used to synchronization purposes.
110 ¥Ç¡¼¥¿¥Ñ¥±¥Ã¥È¤ÎÂè 1 ¥Ð¥¤¥È¤ÏƱ´ü¤ò¤È¤ë¤Î¤ËÍøÍѤǤ¤ë¡£
111 .\"O .SS "Microsoft protocol"
112 .SS "¥Þ¥¤¥¯¥í¥½¥Õ¥È ¥×¥í¥È¥³¥ë(Microsoft Protocol)"
113 .\"O The \fBMicrosoft\fP protocol uses 1 start bit, 7 data bits, no parity
114 .\"O and one stop bit at the speed of 1200 bits/sec.
115 .\"O Data is sent to RxD in 3-byte packets.
116 .\"O The \fIdx\fP and \fIdy\fP movements are sent as
117 .\"O two's-complement, \fIlb\fP (\fIrb\fP) are set when the left (right)
118 .\"O button is pressed:
119 \fB¥Þ¥¤¥¯¥í¥½¥Õ¥È\fP¥×¥í¥È¥³¥ë¤Ï¡¢1200 bits/sec ¤Î¥¹¥Ô¡¼¥É¤Ç¡¢1 ¥¹
120 ¥¿¡¼¥È¥Ó¥Ã¥È(1 start bit)¡¢7 ¥Ç¡¼¥¿¥Ó¥Ã¥È(7 data bits)¡¢¥Ñ¥ê¥Æ¥£¤Ê
121 ¤·¡¢1 ¥¹¥È¥Ã¥×¥Ó¥Ã¥È(1 stop bit)¤Ç¤¢¤ë¡£
122 ¥Ç¡¼¥¿¤Ï RxD ¤Ë 3 ¥Ð¥¤¥È¤Î¥Ñ¥±¥Ã¥È¤È¤·¤ÆÁ÷¤é¤ì¤ë¡£\fIdx\fP ¤È \fIdy\fP
123 ¤ÎÆ°¤¤Ï 2 ¤ÎÊä¿ôɽ¼¨¤ÇÁ÷¤é¤ì¡¢º¸(±¦)¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤¿»þ¤Ë¤Ï \fIlb\fP
124 (\fIrb\fP)¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£
128 byte d6 d5 d4 d3 d2 d1 d0
129 1 1 lb rb dy7 dy6 dx7 dx6
130 2 0 dx5 dx4 dx3 dx2 dx1 dx0
131 3 0 dy5 dy4 dy3 dy2 dy1 dy0
133 .\"O .SS "3-button Microsoft protocol"
134 .SS "3¤Ä¥Ü¥¿¥ó ¥Þ¥¤¥¯¥í¥½¥Õ¥È ¥×¥í¥È¥³¥ë(3-button Microsoft protocol)"
135 .\"O Original Microsoft mice only have two buttons.
136 .\"O However, there are some
137 .\"O three button mice which also use the Microsoft protocol.
139 .\"O releasing the middle button is reported by sending a packet with zero
140 .\"O movement and no buttons pressed.
141 .\"O (Thus, unlike for the other two buttons, the status of the middle
142 .\"O button is not reported in each packet.)
143 ËÜÍè¤Î¥Þ¥¤¥¯¥í¥½¥Õ¥È¥Þ¥¦¥¹¤Ï 2 ¤Ä¤Î¥Ü¥¿¥ó¤·¤«»ý¤¿¤Ê¤¤¡£¤·¤«¤·¡¢3 ¤Ä¥Ü¥¿¥ó
144 ¤Î¥Þ¥¦¥¹¤Ç¥Þ¥¤¥¯¥í¥½¥Õ¥È¥×¥í¥È¥³¥ë¤Îʪ¤â¸ºß¤¹¤ë¡£¿¿Ãæ¤Î¥Ü¥¿¥ó¤ò²¡¤¹¡¢
145 ¤Þ¤¿¤ÏÊü¤¹¤È¤¤¤¦¤³¤È¤Ï¡¢Æ°¤¥¼¥í¤Ç¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¤¤¤¦¥Ñ¥±¥Ã¥È
146 ¤òÁ÷¤ë¤³¤È¤ÇÅÁ¤¨¤é¤ì¤ë¡£(½¾¤Ã¤Æ¾¤ÎÆó¤Ä¤Î¥Ü¥¿¥ó¤È°ã¤¤¡¢¿¿Ãæ¤Î¥Ü¥¿
147 ¥ó¤Î¥¹¥Æ¡¼¥¿¥¹¤Ï¡¢¤½¤ì¤¾¤ì¤Î¥Ñ¥±¥Ã¥È¤«¤é¤ÏÅÁ¤ï¤Ã¤ÆÍè¤Ê¤¤¡£)
148 .\"O .SS "Logitech protocol"
149 .SS "¥í¥¸¥Æ¥Ã¥¯ ¥×¥í¥È¥³¥ë(Logitech protocol)"
150 .\"O Logitech serial 3-button mice use a different extension of the
151 .\"O Microsoft protocol: when the middle button is up, the above 3-byte
153 .\"O When the middle button is down a 4-byte packet is
154 .\"O sent, where the 4th byte has value 0x20 (or at least has the 0x20
156 .\"O In particular, a press of the middle button is reported
157 .\"O as 0,0,0,0x20 when no other buttons are down.
158 ¥í¥¸¥Æ¥Ã¥¯ ¥·¥ê¥¢¥ë 3¤Ä¥Ü¥¿¥ó¥Þ¥¦¥¹¤Ï¡¢¥Þ¥¤¥¯¥í¥½¥Õ¥È ¥×¥í¥È¥³¥ë¤È¤Ï
159 °Û¤Ê¤Ã¤¿³ÈÄ¥¤ò¤·¤Æ¤¤¤ë¡£:¿¿Ãæ¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤Æ¤Ê¤¤¤È¡¢¾åµ 3¥Ð¥¤¥È¤Î
160 ¥Ñ¥±¥Ã¥È¤¬Á÷¤é¤ì¤ë¡£¿¿Ãæ¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤Æ¤¤¤ë¤È¡¢4¥Ð¥¤¥È¤Î¥Ñ¥±¥Ã¥È¤¬
161 Á÷¤é¤ì¤ë¡£Â裴¥Ð¥¤¥È¤Ï 0x20 ¤ÎÃͤò»ý¤Ã¤Æ¤¤¤ë(¤¢¤ë¤¤¤Ï¡¢¾¯¤Ê¤¯¤È¤â 0x20
162 ¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë)¡£ ⤷¡¢Â¾¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤Æ¤¤¤Ê¤¤¾õÂ֤ǡ¢
163 ¿¿Ãæ¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤ë¤È¡¢0,0,0,0x20 ¤ÈÅÁ¤¨¤é¤ì¤ë¡£
164 .\"O .SS "Mousesystems protocol"
165 .SS "¥Þ¥¦¥¹¥·¥¹¥Æ¥à¥º ¥×¥í¥È¥³¥ë(Mousesystems protocol)"
166 .\"O The \fBMousesystems\fP protocol uses 1 start bit, 8 data bits, no parity
167 .\"O and two stop bits at the speed of 1200 bits/sec.
168 .\"O Data is sent to RxD in
170 .\"O \fIdx\fP is sent as the sum of the two two's-complement
171 .\"O values, \fIdy\fP is send as negated sum of the two two's-complement
173 .\"O \fIlb\fP (\fImb\fP, \fIrb\fP) are cleared when the left (middle,
174 .\"O right) button is pressed:
175 \fB¥Þ¥¦¥¹¥·¥¹¥Æ¥à¥º\fP¥×¥í¥È¥³¥ë¤Ï¡¢1200 bits/sec¤Ç¡¢1 ¥¹¥¿¡¼¥È¥Ó¥Ã¥È¡¢
176 8 ¥Ç¡¼¥¿¥Ó¥Ã¥È¡¢¥Ñ¥ê¥Æ¥£¤Ê¤·¡¢2 ¥¹¥È¥Ã¥×¥Ó¥Ã¥È¤Ç¤¢¤ë¡£
177 ¥Ç¡¼¥¿¤Ï¡¢RxD ¤Ë 5 ¥Ð¥¤¥È¤Î¥Ñ¥±¥Ã¥È¤È¤·¤ÆÁ÷¤é¤ì¤ë¡£\fIdx\fP ¤Ï 2 ¤Ä¤Î
178 2 ¤ÎÊä¿ô¤ÎϤȤ·¤ÆÁ÷¤é¤ì¡¢\fIdy\fP ¤Ï 2 ¤Ä¤Î 2 ¤ÎÊä¿ô¤ÎϤÎÈÝÄê
179 ¤È¤·¤ÆÁ÷¤é¤ì¤ë¡£º¸(Ãæ¡¢±¦)¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤¿»þ¤Ë¤Ï\fIlb\fP
180 (\fImb\fP, \fIrb\fP) ¤¬¥¯¥ê¥¢¤µ¤ì¤ë¡£
184 byte d7 d6 d5 d4 d3 d2 d1 d0
186 2 0 dxa6 dxa5 dxa4 dxa3 dxa2 dxa1 dxa0
187 3 0 dya6 dya5 dya4 dya3 dya2 dya1 dya0
188 4 0 dxb6 dxb5 dxb4 dxb3 dxb2 dxb1 dxb0
189 5 0 dyb6 dyb5 dyb4 dyb3 dyb2 dyb1 dyb0
192 .\"O Bytes 4 and 5 describe the change that occurred since bytes 2 and 3
193 .\"O were transmitted.
194 Âè 4,5 ¥Ð¥¤¥È¤Ë¤Ï¡¢Âè 2,3 ¥Ð¥¤¥È¤¬Á÷¤é¤ì¤¿¤¢¤ÈÀ¸¤¸¤¿Êѹ¹¤¬µ½Ò¤µ¤ì¤ë¡£
195 .\"O .SS "Sun protocol"
196 .SS "¥µ¥ó ¥×¥í¥È¥³¥ë(Sun protocol)"
197 .\"O The \fBSun\fP protocol is the 3-byte version of the above 5-byte
198 .\"O Mousesystems protocol: the last two bytes are not sent.
199 \fB¥µ¥ó\fP ¥×¥í¥È¥³¥ë¤Ï¡¢¾åµ¤Î 5 ¥Ð¥¤¥È ¥Þ¥¦¥¹¥·¥¹¥Æ¥à¥×¥í¥È¥³¥ë¤Î 3
200 ¥Ð¥¤¥ÈÈǤǤ¹¡£¸å¤Î 2 ¥Ð¥¤¥È¤ÏÁ÷¤é¤ì¤Þ¤»¤ó¡£
201 .\"O .SS "MM protocol"
202 .SS "MM ¥×¥í¥È¥³¥ë(MM protocol)"
203 .\"O The \fBMM\fP protocol uses 1 start bit, 8 data bits, odd parity and one
204 .\"O stop bit at the speed of 1200 bits/sec.
205 .\"O Data is sent to RxD in 3-byte
207 .\"O \fIdx\fP and \fIdy\fP are sent as single signed values, the
208 .\"O sign bit indicating a negative value.
209 .\"O \fIlb\fP (\fImb\fP, \fIrb\fP) are
210 .\"O set when the left (middle, right) button is pressed:
211 \fBMM\fP ¥×¥í¥È¥³¥ë¤Ï 1200 bits/sec ¤Ç 1 ¥¹¥¿¡¼¥È¥Ó¥Ã¥È¡¢8 ¥Ç¡¼¥¿¥Ó¥Ã
212 ¥È¡¢´ñ¿ô¥Ñ¥ê¥Æ¥£¡¢ 1 ¥¹¥È¥Ã¥×¥Ó¥Ã¥È¤ò»È¤¦¡£¥Ç¡¼¥¿¤Ï RxD ¤Ë 3 ¥Ð¥¤¥È¤Î¥Ñ
213 ¥±¥Ã¥È¤È¤·¤ÆÁ÷¤é¤ì¤ë¡£\fIdx\fP ¤È \fIdy\fP ¤Ï°ì¤Ä¤ÎÉä¹æ¤Ä¤¤ÎÃͤȤ·¤Æ
214 Á÷¤é¤ì¡¢¥µ¥¤¥ó¥Ó¥Ã¥È¤ÏÉé¤ÎÃͤòɽ¤¹¡£º¸(Ãæ¡¢±¦)¤Î¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤¿»þ¤Ë¤Ï
215 \fIlb\fP (\fImb\fP, \fIrb\fP)¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£
219 byte d7 d6 d5 d4 d3 d2 d1 d0
220 1 1 0 0 dxs dys lb mb rb
221 2 0 dx6 dx5 dx4 dx3 dx2 dx1 dx0
222 3 0 dy6 dy5 dy4 dy3 dy2 dy1 dy0
228 .\"O A commonly used symlink pointing to a mouse device.
229 °ìÈÌŪ¤Ë¥Þ¥¦¥¹¥Ç¥Ð¥¤¥¹¤ò¤µ¤¹¤Î¤Ë»È¤ï¤ì¤ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯