PS2 Mouse

In ps2 library example code I can see 0xff and 0xeb what do they mean and where can I read about them more? How can I decode status byte given by touchpad?

There also a weird dance done to detect whether you have an “advanced” mouse (scroll wheel, extra buttons) using only the commands present on simple mice...

The Microsoft Intellimouse operates just like a standard PS/2 mouse (ie, it uses a 3-byte movement data packet, responds to all commands in the same way as a standard PS/2 mouse, and reports a device ID of 0x00.) To enter scrolling wheel mode, the host sends the following command sequence:

Set sample rate 200
Set sample rate 100
Set sample rate 80

The host then issues the "Get device ID" command (0xF2) and waits for a response. If a standard PS/2 mouse (ie, non-Intellimouse) is attached, it will respond with a device ID of 0x00. In this case, the host will recognize the fact that the mouse does have a scrolling wheel and will continue to treat it as a standard PS/2 mouse. However, if a Microsoft Intellimouse is attached, it will respond with an ID of 0x03.