Penguin
Annotated edit history of mouse(4) version 3, including all changes. View license author blame.
Rev Author # Line
1 perry 1 !!NAME
2 JohnMcPherson 2 mouse - serial mouse interface
1 perry 3
4 !!CONFIG
2 JohnMcPherson 5 Serial mice are connected to a serial [RS232]/V24 dialout line, see ttys(4) for a description.
1 perry 6
7 !!DESCRIPTION
8
9
2 JohnMcPherson 10 !Introduction
11 The pinout of the usual 9 pin plug as used for serial mice is:
1 perry 12
13
2 JohnMcPherson 14
3 JohnMcPherson 15 |pin|name|used for
16 |2|RX|Data
17 |3|TX|-12 V, Imax = 10 mA
18 |4|DTR|+12 V, Imax = 10 mA
19 |7|RTS|+12 V, Imax = 10 mA
20 |5|GND|Ground
1 perry 21
22
23 This is the specification, in fact 9 V suffices with most mice.
24
2 JohnMcPherson 25 The mouse driver can recognize a mouse by dropping RTS to low and raising 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').
1 perry 26
2 JohnMcPherson 27 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:
1 perry 28
29
2 JohnMcPherson 30
3 JohnMcPherson 31 |bit/s|string
32 |9600|*q
33 |4800|*p
34 |2400|*o
35 |1200|*n
1 perry 36
37
38 The first byte of a data packet can be used to synchronisation purposes.
39
2 JohnMcPherson 40 !"Microsoft protocol"
41 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:
1 perry 42
43
44
3 JohnMcPherson 45 |byte|d6|d5|d4|d3|d2|d1|d0
46 |1|1|lb|rb|dy7|dy6|dx7|dx6
47 |2|0|dx5|dx4|dx3|dx2|dx1|dx0
48 |3|0|dy5|dy4|dy3|dy2|dy1|dy0
1 perry 49
50
2 JohnMcPherson 51 !"3-button Microsoft protocol"
52 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 buttons, the status of the middle button is not reported in each packet.)
1 perry 53
2 JohnMcPherson 54 !"Logitech protocol"
55 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.
1 perry 56
2 JohnMcPherson 57 !"Mousesystems protocol"
58 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 values, ''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:
1 perry 59
60
61
3 JohnMcPherson 62 |byte|d7|d6|d5|d4|d3|d2|d1|d0
63 |1|1|0|0|0|0|lb|mb|rb
64 |2|0|dxa6|dxa5|dxa4|dxa3|dxa2|dxa1|dxa0
65 |3|0|dya6|dya5|dya4|dya3|dya2|dya1|dya0
66 |4|0|dxb6|dxb5|dxb4|dxb3|dxb2|dxb1|dxb0
67 |5|0|dyb6|dyb5|dyb4|dyb3|dyb2|dyb1|dyb0
1 perry 68
69
70 Bytes 4 and 5 describe the change that occurred since bytes 2 and 3 were transmitted.
71
2 JohnMcPherson 72 !"Sun protocol"
73 The __Sun__ protocol is the 3-byte version of the above 5-byte Mousesystems protocol: the last two bytes are not sent.
1 perry 74
2 JohnMcPherson 75 !"MM protocol"
76 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 packets. ''dx'' and ''dy'' are sent as single signed values, the sign bit indicating a negative value. ''lb'' (''mb'', ''rb'') are set when the left (middle, right) button is pressed:
1 perry 77
78
79
3 JohnMcPherson 80 |byte|d7|d6|d5|d4|d3|d2|d1|d0
81 |1|1|0|0|dxs|dys|lb|mb|rb
82 |2|0|dx6|dx5|dx4|dx3|dx2|dx1|dx0
83 |3|0|dy6|dy5|dy4|dy3|dy2|dy1|dy0
1 perry 84
85
86 !!FILES
87
2 JohnMcPherson 88 ;''/dev/mouse'' : A commonly used symlink pointing to a mouse device.
1 perry 89
90
91
92 !!SEE ALSO
93 ttys(4), gpm(8)
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 12 times)