MOUSE(4) Linux Programmer’s Manual MOUSE(4) 名前 mouse - シリアルマウスインターフェース 設定 シリアルマウスは RS232/V24 ダイアルアウトラインに接続される。 RS232/V24 ダイアルアウトライン については ttyS(4) を参照のこと。 説明 概説 シリアルマウスで使われる普通の 9 ピンプラグのピン配列は以下である: pin name used for 2 RX Data 3 TX -12 V, Imax = 10 mA 4 DTR +12 V, Imax = 10 mA 7 RTS +12 V, Imax = 10 mA 5 GND Ground これは仕様書であり、実際はほとんどのマウスでは 9 V で十分である。 マウスドライバは RTS をロー(low)に落し、再び上げることによって、マウ ス を認識できる。およそ 14 ms 後、マウスはデータライン上に 0x4D ('M') を送 るだろう。さらに 63ms あと、マイクロソフト互換 3ボタンマ ウ ス は 0x33 ('3') を送る。 マ ウスの相対的な移動は、dx(正が右)とdy(正が下)として伝えられる。各種の マウスは異なったスピードで操作できる。スピードを選択するには、下の表 の 2 文字を送ってから 0.1 秒待つことで、9600, 4800, 2400, 1200 bit/s を順 に選べる。以下の表では選択可能なスピードとそれを選択するための文字列 を 示している。 bit/s string 9600 *q 4800 *p 2400 *o 1200 *n データパケットの第 1 バイトは同期をとるのに利用できる。 マイクロソフト プロトコル(Microsoft Protocol) マ イクロソフトプロトコルは、1200 bits/sec のスピードで、1 スタートビッ ト(1 start bit)、7 データビット(7 data bits)、パリティなし、1 ストッ プ ビ ット(1 stop bit)である。データは RxD に 3 バイトのパケットとして送ら れる。dx と dy の動きは 2 の補数表示で送られ、左(右)のボタンが押され た 時には lb (rb)がセットされる。 byte d6 d5 d4 d3 d2 d1 d0 1 1 lb rb dy7 dy6 dx7 dx6 2 0 dx5 dx4 dx3 dx2 dx1 dx0 3 0 dy5 dy4 dy3 dy2 dy1 dy0 3つボタン マイクロソフト プロトコル(3-button Microsoft protocol) 本来のマイクロソフトマウスは 2 つのボタンしか持たない。しかし、3 つボタ ンのマウスでマイクロソフトプロトコルの物も存在する。真中のボタンを押 す 、 または放すということは、動きゼロでボタンが押されていないというパケッ トを送ることで伝えられる。(従って他の二つのボタンと違い、真中のボタンの ステータスは、それぞれのパケットからは伝わって来ない。) ロジテック プロトコル(Logitech protocol) ロ ジテック シリアル 3つボタンマウスは、マイクロソフト プロトコルとは異 なった拡張をしている。:真中のボタンが押されてないと、上記 3バイトのパケ ットが送られる。真中のボタンが押されていると、4バイトのパケットが送られ る。第4バイトは 0x20 の値を持っている(あるいは、少なくとも 0x20 ビット が セットされている)。 但し、他のボタンが押されていない状態で、真中のボ タンが押されると、0,0,0,0x20 と伝えられる。 マウスシステムズ プロトコル(Mousesystems protocol) マウスシステムズプロトコルは、1200 bits/secで、1 スタートビット、 8 デ ータビット、パリティなし、2 ストップビットである。データは、RxD に 5 バ イトのパケットとして送られる。dx は 2 つの 2 の補数の和として送られ、dy は 2 つの 2 の補数の和の否定として送られる。左(中、右)のボタンが押され た時にはlb (mb, rb) がクリアされる。 byte d7 d6 d5 d4 d3 d2 d1 d0 1 1 0 0 0 0 lb mb rb 2 0 dxa6 dxa5 dxa4 dxa3 dxa2 dxa1 dxa0 3 0 dya6 dya5 dya4 dya3 dya2 dya1 dya0 4 0 dxb6 dxb5 dxb4 dxb3 dxb2 dxb1 dxb0 5 0 dyb6 dyb5 dyb4 dyb3 dyb2 dyb1 dyb0 第 4,5 バイトには、第 2,3 バイトが送られたあと生じた変更が記述される。 サン プロトコル(Sun protocol) サン プロトコルは、上記の 5 バイト マウスシステムプロトコルの 3 バイ ト 版です。後の 2 バイトは送られません。 MM プロトコル(MM protocol) MM プロトコルは 1200 bits/sec で 1 スタートビット、8 データビット、奇数 パリティ、 1 ストップビットを使う。データは RxD に 3 バイトのパケットと して送られる。dx と dy は一つの符号つきの値として送られ、サインビットは 負の値を表す。左(中、右)のボタンが押された時には lb (mb, rb)がセット さ れる。 byte d7 d6 d5 d4 d3 d2 d1 d0 1 1 0 0 dxs dys lb mb rb 2 0 dx6 dx5 dx4 dx3 dx2 dx1 dx0 3 0 dy6 dy5 dy4 dy3 dy2 dy1 dy0 ファイル /dev/mouse 一般的にマウスデバイスをさすのに使われるシンボリックリンク 関連項目 ttyS(4), gpm(8) Linux 1996-02-10 MOUSE(4)
MOUSE(4) Linux Programmer’s Manual MOUSE(4) NAME mouse - serial mouse interface CONFIGURATION Serial mice are connected to a serial RS232/V24 dialout line, see ttyS(4) for a description. DESCRIPTION Introduction The pinout of the usual 9 pin plug as used for serial mice is: pin name used for 2 RX Data 3 TX -12 V, Imax = 10 mA 4 DTR +12 V, Imax = 10 mA 7 RTS +12 V, Imax = 10 mA 5 GND Ground This is the specification, in fact 9 V suffices with most mice. The mouse driver can recognize a mouse by dropping RTS to low and rais- ing it again. About 14 ms later the mouse will send 0x4D ('M') on the data line. After a further 63 ms, a Microsoft-compatible 3-button mouse will send 0x33 ('3'). The relative mouse movement is sent as dx (positive means right) and dy (positive means down). Various mice can operate at different speeds. To select speeds, cycle through the speeds 9600, 4800, 2400 and 1200 bit/s, each time writing the two characters from the table below and waiting 0.1 seconds. The following table shows available speeds and the strings that select them: bit/s string 9600 *q 4800 *p 2400 *o 1200 *n The first byte of a data packet can be used to synchronization pur- poses. Microsoft protocol The Microsoft protocol uses 1 start bit, 7 data bits, no parity and one stop bit at the speed of 1200 bits/sec. Data is sent to RxD in 3-byte packets. The dx and dy movements are sent as two’s-complement, lb (rb) are set when the left (right) button is pressed: byte d6 d5 d4 d3 d2 d1 d0 1 1 lb rb dy7 dy6 dx7 dx6 2 0 dx5 dx4 dx3 dx2 dx1 dx0 3 0 dy5 dy4 dy3 dy2 dy1 dy0 3-button Microsoft protocol Original Microsoft mice only have two buttons. However, there are some three button mice which also use the Microsoft protocol. Pressing or releasing the middle button is reported by sending a packet with zero movement and no buttons pressed. (Thus, unlike for the other two but- tons, the status of the middle button is not reported in each packet.) Logitech protocol Logitech serial 3-button mice use a different extension of the Microsoft protocol: when the middle button is up, the above 3-byte packet is sent. When the middle button is down a 4-byte packet is sent, where the 4th byte has value 0x20 (or at least has the 0x20 bit set). In particular, a press of the middle button is reported as 0,0,0,0x20 when no other buttons are down. Mousesystems protocol The Mousesystems protocol uses 1 start bit, 8 data bits, no parity and two stop bits at the speed of 1200 bits/sec. Data is sent to RxD in 5-byte packets. dx is sent as the sum of the two two’s-complement val- ues, dy is send as negated sum of the two two’s-complement values. lb (mb, rb) are cleared when the left (middle, right) button is pressed: byte d7 d6 d5 d4 d3 d2 d1 d0 1 1 0 0 0 0 lb mb rb 2 0 dxa6 dxa5 dxa4 dxa3 dxa2 dxa1 dxa0 3 0 dya6 dya5 dya4 dya3 dya2 dya1 dya0 4 0 dxb6 dxb5 dxb4 dxb3 dxb2 dxb1 dxb0 5 0 dyb6 dyb5 dyb4 dyb3 dyb2 dyb1 dyb0 Bytes 4 and 5 describe the change that occurred since bytes 2 and 3 were transmitted. Sun protocol The Sun protocol is the 3-byte version of the above 5-byte Mousesystems protocol: the last two bytes are not sent. MM protocol The MM protocol uses 1 start bit, 8 data bits, odd parity and one stop bit at the speed of 1200 bits/sec. Data is sent to RxD in 3-byte pack- ets. dx and dy are sent as single signed values, the sign bit indicat- ing a negative value. lb (mb, rb) are set when the left (middle, right) button is pressed: byte d7 d6 d5 d4 d3 d2 d1 d0 1 1 0 0 dxs dys lb mb rb 2 0 dx6 dx5 dx4 dx3 dx2 dx1 dx0 3 0 dy6 dy5 dy4 dy3 dy2 dy1 dy0 FILES /dev/mouse A commonly used symlink pointing to a mouse device. SEE ALSO ttyS(4), gpm(8) COLOPHON This page is part of release 3.22 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 1996-02-10 MOUSE(4)
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa