Search code examples
mousehardware

Is the Microsoft Intellimouse PS/2 packet format a standard across all PS/2 mice with scroll wheels or extra buttons?


I'm currently developing microcontroller firmware to read a PS/2 mouse in C. My interface works with a standard 2-button mouse with no issues, but I would like to implement support for 3+ button PS/2 mice with scroll wheels. The only real description for the data format of this kind of mouse is the Microsoft Intellimouse format (As described on this page).

For Intellimouse, I am to send a bootup sequence then an 0xF2 "Get Device ID" command, and a response of 0x03 denotes that the mouse is an Intellimouse, and has a scroll wheel. There is a 2nd sequence to detect 4th and 5th mouse buttons. I can use these to query the attached mouse on bootup and determine if the mouse data packet size is 3 or 4 bytes, but I want to make sure it will work for all mice with this functionality.

My question: Is this Intellimouse command sequence and format considered the standard for any PS/2 mouse that's using 3 or more buttons or a scroll wheel? Will all mice with these features return this 0x03 in response to device ID?

Thanks much for the help!


Solution

  • All PS/2 Mice are in the disabled state, and their Device IDs are 0x00, by default. When we plug a PS/2 mouse into the PS/2 Port, the mouse will send 0xAA and 0x00 to KBC automatically, where the 0xAA means a successfull self-test and 0x00 is its ID. In other words, the default data packet is 3-byte format.

    We need special command sequence set to enable the 4th byte data format. For example, F3+C8, F3+64 and F3+50 with IntelliMouse (ID=0x03) and F3+C8, F3+C8, C3+50 with 5-button mice (ID=0x04). However, you can get ID 0x00 only on the standard two-button mice.

    The standard two-button mouse ID is fixed at 0x00. However, the 5-button mice can get different Device ID (0x00, 0x03 or 0x04) that depends on the initial command sequence.

    In my experience, to support multiple mice at the same time, once we get a ID with 0x03 or 0x04, we have to add an emulated 4th byte with the standard two-button mice to make sure all the data packet are 4-byte format. (Or you will see the crazy pointer on the screen.)

    Under the Windows O/S, you can install the Multiplex driver that supports 3-byte and 4-byte mice at the same time. Of course, it creates new commands (0x90 ~ 0x93) as MICE channel in Keyboard Controller.

    (http://www.isdaman.com/alsos/hardware/mouse/mouse2.pdf)