I'm working on a research project for class and I need to be able to log keystrokes with accurate timing information. This keystroke data will be combined with audio and seismic data from the same key press events, so the more accurate the timing, the better (hoping for +/- 2ms).

I plan on running the software on a personal laptop that will be set up for the test subjects, so I don't care if the software is Windows or Linux. However, I'm less comfortable with Linux at the moment so Windows is preferred.

It doesn't need to be hidden. (I would prefer if it was not.)

It does need a way to start/stop the logging.

It needs to be able to log characters like LeftShift and RightShift separately, and also characters that aren't displayed like Backspace.

If this can be done in a browser, it would be even better. As long as the timing is still accurate.

If I can get the output as a CSV or TSV that would be ideal.

Does anyone have a suggestion?

I realize there are plenty of shady keyloggers in existence, or that I could write my own. That is outside the scope of my project.