How can I get the duration time of a key press with Psychtoolbox?
Afficher commentaires plus anciens
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)
Arjun
le 3 Mar 2025
0 votes
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:
- https://www.mathworks.com/matlabcentral/answers/362688-calculate-and-print-the-duration-of-keypress
- https://www.mathworks.com/matlabcentral/answers/318995-how-to-get-the-duration-of-a-pressed-key-in-matlab
I hope this helps!
Catégories
En savoir plus sur Timing and presenting 2D and 3D stimuli dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!