I’m looking for a way to detect keyboard, mouse and trackpad activity on Linux. This will probably be a kernel module. I don’t care about the details of the input just the fact that something happened. I don’t want it to depend on X. From the kernel headers I’ve noticed that there’s a callback method for keyboard input so that doesn’t look like too much of a problem.
I’ve looked at the kernel headers and libevdev but haven’t found anything similar for mouse and trackpad input. With an evdev example program that I tried it required the device name in /dev/input that are mostly named event(n). It didn’t work with /dev/input/mice. Also, I’m not sure it’s a good idea to open a file and keep it open waiting for events?