How can I get the duration time of a key press with Psychtoolbox?

I am designing an experiment where subjects have to respond continously at two stimuli which will be presented alternately. They will be respond with two key presses: e.g. "a" for stimulus 1 and "b" for stimulus 2.
I need to know which key is pressed and for how long each key is hold down during each trial.
For the former I can use KbCheck but I don't know how to obtain the latter information.
Can anyone help me, please?
Best.

Réponses (1)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by