Freeware for measuring keystroke duration I am searching for freeware to measure the duration of a keystroke or mouse-click, both would work. Does anyone have an idea?

Matlab toolboxes are, unfortunately, of no use to me.
Psychopy (http://psychopy.org) can do this. It can do it in two ways.


Using iohub. Iohub is a crazy powerful way to get any information about any kind of input to your system, from keyboard, mouse, eye-trackers, etc. You can see the documentation for keyboard here.

from psychopy.iohub import launchHubServer
io = launchHubServer()
keyboard = io.devices.keyboard  # handy name

print 'start pressing a key now'
key_info = keyboard.waitForReleases()[0]  # Just grab first release, even if there are multiple
print 'Press time was', key_info.duration
print '... and BTW, all key event info was', key_info

Using pyglet: 

from psychopy import visual, event, core
win = visual.Window()  # Disadvantage: you need to have a window open to record it.
clock = core.Clock()

# Start listening
print 'start pressing a key now'
key, time = event.waitKeys(timeStamped=True)[0]
clock.reset()  # Key down time
while event.getKeys():
    pass
print 'key lasted', clock.getTime(), 'seconds'



If measuring key strokes is the only thing you need, psychopy may be a bit heavy since it is meant for running full experiments, but it will do the job!