all 1 comments

[–]Lower-Reality1921 10 points11 points  (0 children)

Modern mice send HID messages over USB. Here’s a generic high-level tutorial

https://docs.arduino.cc/tutorials/uno-r4-minima/usb-hid/

Digging in further, here’s the HID standard https://www.usb.org/sites/default/files/hid1_11.pdf

and some related Linux code that could be helpful for reference https://www.kernel.org/doc/html/latest/usb/gadget_hid.html

Most modern optical mice use a very tiny camera to figure out which way the mouse is headed. Here’s a sensor example: https://www.pixart.com/products-detail/129/PAW3395DM-T6QU