Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 340
  • Last Modified:

Keystroke Count and Idle Time

I support an app that is used by data-entry clerks running on win95, I'd like to capture their keystroke count and idle time for reporting.  Any nifty pieces of code or tips out there for capturing this type of info?

0
robsdman
Asked:
robsdman
1 Solution
 
alexoCommented:
See the SetWindowsHookEx() API.  You can capture keystrokes using a WH_KEYBOARD hook either globally or per-thread.  You can calculate the idle time by noting the time when each keystroke arrives.

See the SetWindowsHookEx() documentation.  Visual C++ also contains sample applications.

If you want to integrate the capturing into the application itself, you can preprocess the keyboard messages (WM_KEYDOWN, etc.) or WM_CHAR messages.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now