There should be some way to access it through C and/or ObjectiveC, but exactly how is a different question. The Apple Developer Site has a pretty good set of documentation; you'll probably want to start looking here for stuff on I/O Kit and the HID related frameworks.
Unless this is something that's going to poll constantly I'd just cheat and run ioreg; it only takes six hundredths of a second to run according to my shell's timeing.
In reply to Re^3: Detecting idle time on Mac
by Fletch
in thread Detecting idle time on Mac
by sgifford
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |