GetChar with timeout? (PTB2)

Hello,
I am using PTB 2.54 for Windows (with the updated waitSecs and CopyText).

What I need is a timed version of GetChar.

DETAILS:
I am running memory experiments, and need to collect user input consisting of entire
typed words (not just single keypresses). I've been using GetChar in loops and that has
worked fine for cases in which there is no time limit on responses. Now I need to create a
memory test that will automatically advance after a certain amount of time has elapsed,
whether the user has pressed any keys or not.

GetChar won't work for this, as it will keep waiting for a keypress forever.
I've been trying to make a function based on KbCheck that loops until the next key of a
response is pressed OR until the time runs out. But I keep getting one of two problems:
1) the function detects the same single keypress many times over, OR
2) the function detects each keypress only once, except that it misses some keypresses
when user types any faster than a henpeck.

So what I really need is a timed version of GetChar. I figured I could try getting under the
hood of GetChar and altering it to add a timeout feature... but I can't find the source code!
GetChar.m just has the help text, and if there's anything inside GetChar.dll, I don't know
how to open it or change it.

If anyone can help me, I would sincerely appreciate it.
I know at least one suggestion might be to move to PTB3, but that just isn't an option for
me yet.
thank you,
~jason


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jason R. Finley
Graduate Student, Department of Psychology
Cognitive Division
University of Illinois, Urbana-Champaign

uniace@...
jrfinley@...
http://www.jasonfinley.com/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use ChairAvail in a loop, and only call getChar when there's a key to
read.

--- In psychtoolbox@yahoogroups.com, "Jason Finley" <uniace@...> wrote:
>
> Hello,
> I am using PTB 2.54 for Windows (with the updated waitSecs and
CopyText).
>
> What I need is a timed version of GetChar.
>
> DETAILS:
> I am running memory experiments, and need to collect user input
consisting of entire
> typed words (not just single keypresses). I've been using GetChar
in loops and that has
> worked fine for cases in which there is no time limit on responses.
Now I need to create a
> memory test that will automatically advance after a certain amount
of time has elapsed,
> whether the user has pressed any keys or not.
>
> GetChar won't work for this, as it will keep waiting for a keypress
forever.
> I've been trying to make a function based on KbCheck that loops
until the next key of a
> response is pressed OR until the time runs out. But I keep getting
one of two problems:
> 1) the function detects the same single keypress many times over, OR
> 2) the function detects each keypress only once, except that it
misses some keypresses
> when user types any faster than a henpeck.
>
> So what I really need is a timed version of GetChar. I figured I
could try getting under the
> hood of GetChar and altering it to add a timeout feature... but I
can't find the source code!
> GetChar.m just has the help text, and if there's anything inside
GetChar.dll, I don't know
> how to open it or change it.
>
> If anyone can help me, I would sincerely appreciate it.
> I know at least one suggestion might be to move to PTB3, but that
just isn't an option for
> me yet.
> thank you,
> ~jason
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Jason R. Finley
> Graduate Student, Department of Psychology
> Cognitive Division
> University of Illinois, Urbana-Champaign
>
> uniace@...
> jrfinley@...
> http://www.jasonfinley.com/
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>