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

4 visualizzazioni (ultimi 30 giorni)
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.

Risposte (1)

Arjun
Arjun il 3 Mar 2025
I see that you want to get the time duration for which a key was pressed.
You can refer to the following MATLAB Answers inorder to explore some ways in which it can be done:
I hope this helps!

Community Treasure Hunt

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

Start Hunting!

Translated by