Using ioctl to read mice inputs

I was wondering if its possible to read mouse inputs using ioctl functions somehow ? If it is not too much of trouble can anyone write or even direct me to sample code of ioctl reading someother HID.

Usually, mice are serial devices (or USB serial) devices. If you're not doing device driver work, then just reading from the serial device using read() usually gets the data you're looking for. Translating that data is a matter of knowing the packet specification.

What OS are you using?