Prevent keyboard key from being held down

2 views (last 30 days)
Jake
Jake on 10 Jun 2014
I am a complete MATLAB novice and am using it with psychtoolbox to create a word reaction time task with a timed memory element.
At the moment if the 't' key is pressed the elapsed time is displayed for 2.5 seconds, however if a the 't' key is held down it prevents the next word from being displayed, because of this...
while KbCheck WaitSecs(0.1); end
If I delete this then the words are displayed correctly but if the 't' key is held down the elapsed time is displayed constantly, which means participants could cheat the timed memory aspect.
Is there an easy way to prevent this, for example an auto key release, I want the elapsed time to be displayed for 2.5 seconds regardless of whether the 't' key is help or pressed.
Thanks if advanced, hope that is clear enough.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!