I know I can get user idle time using C winapi library as follows:
LASTINPUTINFO lii = {sizeof(LASTINPUTINFO), 0};
GetLastInputInfo(&lii); //error handling ommitted, not the point here
int CurIdleTime = (getTickCount() - (lii.dwTime))/1000;
It is also possible to do it in UNIX systems as the top
command displays user idle time correctly.
Is there an easy multiplatform way to get user idle time in C? if not, which libraries can help me doing that in order not to be OS-dependant?