Search code examples
cross-platformmouseplatform

How is a mouse (or a USB device) platform independent?


I'm interested in knowing the specifics of how exactly is it that a mouse can work with ANY operating system right when you plug it in. For me, this is incredible. How does the mouse communicate with the OS?
Why can't every software be platform independent?


Solution

  • The USB specificationsust a type of device called a human interface device. These devices use specific, know. Protocols to send their data. Amy platform with a USB port is able to detect the specific USB message identifying a device as HID.

    Other devices takeich longer to set up because their specific indication messages are not preprogrammed into the USB port code because it is not enormously common like a keyboard or mouse is.

    So to sum up, they are not rally platform independent, but all platforms are programmed to recognize them out of the box.

    Wikipedia has a pretty good article of HID devices. Look it up if you are curious.