MarcG
1/24/2008 10:50:00 AM
Alex, Linda,
Thanks for three great suggestions. Here's some more background.... I'm
building a suite of psych. performance test tasks. The problem I posed arose
because sometimes subjects fall asleep with their finger on the keyboard or
just hold a key down to "get through" the task. I don't want to treat either
character stream as responses.
Alex, I liked your KeyDown KeyDown KeyDown .... KeyUp check. That avoids the
mucking around with the API's.
Linda, the suggestion about using the Control Panel was really clever and
would work for me since in the test environment we can control the computer
configuration.
I really appreciate the work you did digging through the platform SDK - no
way I would have gone there myself.
It happens, not surprisingly, that since I am building a set of tasks, they
all derive from a common base class. However, one thing that differentiates
the tasks is their input handling, so all the key events are local to each
derived class. This means that I'd have to replicate and probably modify
Alex's solution in each task.
The Control Panel approach is elegantly simple - I never would have thought
of it, but I don't know if I can rely on the setup being done in all cases.
The API approach is rock solid. I can grab the current state in my common
initialization code and turn autorepeat off and restore the state in the
common exit handler. I doubt that the task could get out without generating a
FormClose event.
Thanks both,
Marc