How do mouse events work in linux?

evdev is the generic input event interface. It passes the events generated in the kernel straight to the program, with timestamps…This should be the way for GPM and X to get keyboard and mouse events. It allows for multihead in X without any specific multihead kernel support. The event codes are the same on all architectures and are hardware independent. - SE / Input event codes

You can use blocking and nonblocking reads, and also select() on the /dev/input/eventX devices, and you’ll always get a whole number of input events on a read. - Event interface / input/input.txt

Written on March 23, 2021, Last update on March 30, 2021
linux mouse