Software to measure key-action

I am looking for a software that records key-actions (press/release) and, if possible, visualizes them e.g. with bar diagrams similar to those that MIDI sequencers use. This might help with taking measurements of typical typing habits that could then be fed to a firmware-simulator to debug specific firmware bugs.

Any ideas?