[PLUG] keypress timing logger

Paul Mullen pm at nellump.net
Tue Dec 2 05:14:07 UTC 2014


On Mon, Dec 01, 2014 at 08:39:35PM -0800, Keith Lofstrom wrote:
> I want to time a sequence of events over about five
> minutes, pressing a keyboard key and adding a
> timestamp to a file.
> 
> I can do this by redirecting the output of xev to a
> file, then editing everything but the time field for
> the key presses and dividing by 1000, but there may
> already be a little program that does this the easy
> way.  Any suggestions?

You could do it with a short bash script.  Something like:

  while read -n 1 -s in; do
    echo "$(date)" | tee -a log.txt
  done

That will log a time stamp to stdout and log.txt with each keystroke,
until it gets interrupted.


-- 
Paul



More information about the PLUG mailing list