xref: /reactos/drivers/input/sermouse/sermouse.txt (revision 9393fc32)
1*c2c66affSColin Finck Following information obtained from Tomi Engdahl (then@delta.hut.fi),
2*c2c66affSColin Finck http://www.hut.fi/~then/mytexts/mouse.html
3*c2c66affSColin Finck
4*c2c66affSColin Finck Microsoft serial mouse
5*c2c66affSColin Finck
6*c2c66affSColin Finck   Serial data parameters:
7*c2c66affSColin Finck     1200bps, 7 databits, 1 stop-bit
8*c2c66affSColin Finck
9*c2c66affSColin Finck   Data packet format:
10*c2c66affSColin Finck     Data packet is 3 byte packet. It is send to the computer every time mouse
11*c2c66affSColin Finck     state changes (mouse moves or keys are pressed/released).
12*c2c66affSColin Finck         D7      D6      D5      D4      D3      D2      D1      D0
13*c2c66affSColin Finck     1.  X       1       LB      RB      Y7      Y6      X7      X6
14*c2c66affSColin Finck     2.  X       0       X5      X4      X3      X2      X1      X0
15*c2c66affSColin Finck     3.  X       0       Y5      Y4      Y3      Y2      Y1      Y0
16*c2c66affSColin Finck
17*c2c66affSColin Finck     Note: The bit marked with X is 0 if the mouse received with 7 databits
18*c2c66affSColin Finck     and 2 stop bits format. It is also possible to use 8 databits and 1 stop
19*c2c66affSColin Finck     bit format for receiving. In this case X gets value 1. The safest thing
20*c2c66affSColin Finck     to get everything working is to use 7 databits and 1 stopbit when
21*c2c66affSColin Finck     receiving mouse information (and if you are making mouse then send out
22*c2c66affSColin Finck     7 databits and 2 stop bits).
23*c2c66affSColin Finck     The byte marked with 1. is send first, then the others. The bit D6 in
24*c2c66affSColin Finck     the first byte is used for synchronizing the software to mouse packets
25*c2c66affSColin Finck     if it goes out of sync.
26*c2c66affSColin Finck
27*c2c66affSColin Finck      LB is the state of the left button (1 means pressed down)
28*c2c66affSColin Finck      RB is the state of the right button (1 means pressed down)
29*c2c66affSColin Finck      X7-X0 movement in X direction since last packet (signed byte)
30*c2c66affSColin Finck      Y7-Y0 movement in Y direction since last packet (signed byte)
31*c2c66affSColin Finck
32*c2c66affSColin Finck    Mouse identification
33*c2c66affSColin Finck      When DTR line is toggled, mouse should send one data byte containing
34*c2c66affSColin Finck      letter 'M' (ascii 77).
35*c2c66affSColin Finck
36*c2c66affSColin Finck
37*c2c66affSColin Finck Logitech serial mouse
38*c2c66affSColin Finck
39*c2c66affSColin Finck   Logitech uses the Microsoft serial mouse protocol in their mouses (for
40*c2c66affSColin Finck   example Logitech Pilot mouse and others). The original protocol supports
41*c2c66affSColin Finck   only two buttons, but logitech as added third button to some of their
42*c2c66affSColin Finck   mouse models. To make this possible logitech has made one extension to
43*c2c66affSColin Finck   the protocol.
44*c2c66affSColin Finck   I have not seen any documentation about the exact documents, but here is
45*c2c66affSColin Finck   what I have found out: The information of the third button state is sent
46*c2c66affSColin Finck   using one extra byte which is send after the normal packet when needed.
47*c2c66affSColin Finck   Value 32 (dec) is sent every time when the center button is pressed down.
48*c2c66affSColin Finck   It is also sent every time with the data packet when center button is kept
49*c2c66affSColin Finck   down and the mouse data packet is sent for other reasons. When center
50*c2c66affSColin Finck   button is released, the mouse sends the normal data packet followed by
51*c2c66affSColin Finck   data bythe which has value 0 (dec). As you can see the extra data byte
52*c2c66affSColin Finck   is sent only when you mess with the center button.
53*c2c66affSColin Finck
54*c2c66affSColin Finck
55*c2c66affSColin Finck Mouse systems mouse
56*c2c66affSColin Finck
57*c2c66affSColin Finck   Serial data parameters:
58*c2c66affSColin Finck     1200bps, 8 databits, 1 stop-bit
59*c2c66affSColin Finck
60*c2c66affSColin Finck   Data packet format:
61*c2c66affSColin Finck          D7      D6      D5      D4      D3      D2      D1      D0
62*c2c66affSColin Finck     1.   1       0       0       0       0       LB      CB      RB
63*c2c66affSColin Finck     2.   X7      X6      X5      X4      X3      X2      X1      X0
64*c2c66affSColin Finck     3.   Y7      Y6      Y5      Y4      Y3      Y4      Y1      Y0
65*c2c66affSColin Finck     4.   X7'     X6'     X5'     X4'     X3'     X2'     X1'     X0'
66*c2c66affSColin Finck     5.   Y7'     Y6'     Y5'     Y4'     Y3'     Y4'     Y1'     Y0'
67*c2c66affSColin Finck
68*c2c66affSColin Finck     LB is left button state (0 = pressed, 1 = released)
69*c2c66affSColin Finck     CB is center button state (0 = pressed, 1 = released)
70*c2c66affSColin Finck     RB is right button state (0 = pressed, 1 = released)
71*c2c66affSColin Finck     X7-X0 movement in X direction since last packet in signed byte
72*c2c66affSColin Finck           format (-128..+127), positive direction right
73*c2c66affSColin Finck     Y7-Y0 movement in Y direction since last packet in signed byte
74*c2c66affSColin Finck           format (-128..+127), positive direction up
75*c2c66affSColin Finck     X7'-X0' movement in X direction since sending of X7-X0 packet in
76*c2c66affSColin Finck             signed byte format (-128..+127), positive direction right
77*c2c66affSColin Finck     Y7'-Y0' movement in Y direction since sending of Y7-Y0 packet in
78*c2c66affSColin Finck             signed byte format (-128..+127), positive direction up
79*c2c66affSColin Finck
80*c2c66affSColin Finck     The last two bytes in the packet (bytes 4 and 5) contains information
81*c2c66affSColin Finck     about movement data changes which have occured after data bytes 2 and 3
82*c2c66affSColin Finck     have been sent.
83