A simple way to watch mouse and keyboard usage for tracking purposes
A central library for my own applications to watch for keyboard / mouse usage in order to track active computer use.
If you feel like this is useful, or could be useful for you, feel free to create a feature request. If you think something is not working well, please create a bug report. Thank you!
The idea is very simple: You pass a given 'resolution', like two minutes, and any mouse or keyboard movement within that timeframe will be considered an active time. If the computer is locked usage is not counted.
It's not logging anything. Neither software usage, nor which keys were pressed. You can check.
There is a probe project included, this line is taken from there:
IWatcher watcher = new Watcher("testApp", Resolution.HalfMinute, SavePreference.KeepDataForAWeek, DataPrecision.High);
Then you can just ask, also from the probe project:
TimeSpan usage = watcher.UsageTimeForGivenTimeframe(startTime, startTime + TimeSpan.FromDays(1));