-
Notifications
You must be signed in to change notification settings - Fork 1.7k
IBM PC Mouse
https://www.win.tue.nl/~aeb/linux/kbd/scancodes-13.html
This command will read the secondary device ID of the pointing device (2 bytes). First byte is variant ID(IBM=01) and second one indicates revision of specification.
https://www.win.tue.nl/~aeb/linux/kbd/scancodes-13.html
https://web.archive.org/web/20030714000535/www.dqcs.com/logitech/ps2ppspec.htm
0x00
byte|7 6 5 4 3 2 1 0
----+--------------------------------------------------------------
0|Yovflw Xovflw Ysign Xsign 1 Middle Right Left
1| X movement
2| Y movement
0x03
f3 c8 f3 64 f3 50(set sample rate 200, 100, 80)
byte|7 6 5 4 3 2 1 0
----+--------------------------------------------------------------
0|Yovflw Xovflw Ysign Xsign 1 Middle Right Left
1| X movement
2| Y movement
3| V movement
https://en.wikipedia.org/wiki/IntelliMouse
0x04
f3 c8 f3 c8 f3 50(set sample rate 200, 200, 80)
byte|7 6 5 4 3 2 1 0
----+--------------------------------------------------------------
0|Yovflw Xovflw Ysign Xsign 1 Middle Right Left
1| X movement
2| Y movement
3|0 0 Forward Back V movement
0x??
set sample rate 20, 60, 40, 20, 20, 60, 40, 20, 20
Logitech Mouse report consists of 3 bytes and reports following data.
- X: 9-bit, -255(0x101) to 255(0x0FF)
- Y: 9-bit, -255(0x101) to 255(0x0FF)
- Wheel: 5-bit, -15(0x11) to 15(0x0F)
- Buttons: Left, Right, Middle, Back, Forward, Up, Down, Task, ...
Byte0 is compatible to Standard PS/2 mouse data. But Logitech mouse never overflow its counts, so the overflow bits are used to discriminate mouse report types.
Byte0:
Bit | Description |
---|---|
Bit 7 | Y-overflow (1 if report comes from an external device) |
Bit 6 | X-overflow (1 when Logitech specific report) |
This is compatible to standard report when Byte0 X-overflow bit is 0.
Byte0:
Bit | Description |
---|---|
Bit 7 | 0(Y-overflow) |
Bit 6 | 0(X-overflow) |
Bit 5 | Y-sign |
Bit 4 | X-sign |
Bit 3 | 1 |
Bit 2 | Middle button |
Bit 1 | Right button |
Bit 0 | Left button |
Byte1: X movement, 8-bit
Byte2: Y movement, 8-bit
When Byte0 X-overflow bit is 1, Byte0 both sign bits are 0 and Byte1 is 0xD2
Byte0:
Bit | Description |
---|---|
Bit 7 | -(Y-overflow) |
Bit 6 | 1(X-overflow) |
Bit 5 | 0(Y-sign) |
Bit 4 | 0(X-sign) |
Bit 3 | 1 |
Bit 2 | -(Middle button) |
Bit 1 | -(Right button) |
Bit 0 | -(Left button) |
Byte1:
Bit | Description |
---|---|
Bit 7 | 1 |
Bit 6 | 1 |
Bit 5 | 0 |
Bit 4 | 1 |
Bit 3 | - |
Bit 2 | - |
Bit 1 | - |
Bit 0 | - |
Byte2:
Bit | Description |
---|---|
Bit 7 | 0 |
Bit 6 | 0 |
Bit 5 | Forward button |
Bit 4 | Back button |
Bit 3 | 0 |
Bit 2 | 0 |
Bit 1 | 0 |
Bit 0 | 0 |
When Overflow bits(Bit7, Bit6) of Byte0 are x1 and Byte1 is 0xE2
Byte0:
Bit | Description |
---|---|
Bit 7 | -(Y-overflow) |
Bit 6 | 1(X-overflow) |
Bit 5 | 0(Y-sign) |
Bit 4 | 0(X-sign) |
Bit 3 | 1 |
Bit 2 | -(Middle button) |
Bit 1 | -(Right button) |
Bit 0 | -(Left button) |
Byte1:
Bit | Description |
---|---|
Bit 7 | 1 |
Bit 6 | 1 |
Bit 5 | 1 |
Bit 4 | 0 |
Bit 3 | - |
Bit 2 | - |
Bit 1 | - |
Bit 0 | - |
Byte2:
Bit | Description |
---|---|
Bit 7 | 0 |
Bit 6 | 0 |
Bit 5 | 0 |
Bit 4 | Down button |
Bit 3 | Up button |
Bit 2 | Task button |
Bit 1 | ??? button |
Bit 0 | ??? button |
When X-overflow bit is 1(Byte0 == 0xC8|3-buttons) and Byte1 is 0xD6 or 0xDE
Wheel movement: 5-bit, -1(0x1F) or 1(0x01) [-15(0x11) to 15(0x0F) in theory]
Byte1:
Bit | Description |
---|---|
Bit 7 | 1 |
Bit 6 | 1 |
Bit 5 | 0 |
Bit 4 | 1 |
Bit 3 | - |
Bit 2 | 1 |
Bit 1 | 1 |
Bit 0 | 0 |
Byte2:
Bit | Description |
---|---|
Bit 7 | 0/1 (1 if horizontal) |
Bit 6 | 1 = virtual scroll by Up/Down button |
Bit 5 | 0 |
Bit 4 | 0 |
Bit 3 | Wheel-sign |
Bit 2 | Wheel-2 |
Bit 1 | Wheel-1 |
Bit 0 | Wheel-0 |
Set mouse sample rate in Hz.
Param: {10d, 20d, 40d, 60d, 80d, 100d, 200d}
The reply is a single byte 00. Wait at least 10ms after issuing this command. BallPoint (trackball) devices return a single byte 02, Intellimouse returns 03, Explorer Mouse returns 04, 4d Mouse returns 06, 4dplus Mouse returns 08,as does the Typhoon mouse.
This command is followed by a byte indicating the resolution (0, 1, 2, 3: 1, 2, 4, 8 units per mm, respectively).
Param: {00, 01, 02, 03}
Responds with 3-byte status report.
Byte0:
Bit | Description |
---|---|
Bit 7 | 0 = Always (Reserved for future use) |
Bit 6 | 0 = Stream mode / 1 = Remote mode |
Bit 5 | 0 = Disable / 1 = Enable |
Bit 4 | 0 = Scaling 1:1 / 1 = Scaling 2:1 |
Bit 3 | 0 = Always (Reserved for future use) |
Bit 2 | 1 = Left button depressed |
Bit 1 | 1 = Middle button depressed |
Bit 0 | 1 = Right button depressed |
Byte 1: Current resolution setting (Same format as second byte of ”E8” command)
Byte 2: Current sampling rate (Same format as second byte of ”F3” command)