Search the web
Sign In
New User? Sign Up
psychtoolbox · Psychophysics Toolbox
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Donate Win: GetCharWithTicks.dll   Message List  
Reply | Forward Message #1700 of 10292 |
andy.snyder.wrote

>If a character is available (i.e., CharAvail) before
>the GetCharWithTicks line is reached, GetCharWithTicks returns the
>most current tick value, not the tick value when the character was
>pressed.
>

I've attached a new version of GetCharWithTicks.dll which corrects that problem.
I also fixed it to return the same ASCII codes for the arrow keys as does the
Mac GetChar, thanks to Frans Cornelissen for reporting that discrepancy.


Best,

Allen


>Hi Allen,
>
>Dan Shima and I have been trying the GetCharWithTicks.dll you wrote
>for Windows. If a character is available (i.e., CharAvail) before
>the GetCharWithTicks line is reached, GetCharWithTicks returns the
>most current tick value, not the tick value when the character was
>pressed.
>
>Here is a short program to demonstrate this. (And it also simulates
>the basic routine for which we can not use KbCheck.) On our machine,
>if a key is pressed during the WaitSecs(2) period, the reaction time
>is always 2000 milliseconds insetad of something less.
>
>clear all;
>FlushEvents('keyDown');
>fprintf('Press a key.\n');
>starttick = GetRealTicks;
>% Simulate 2 seconds of WAVRECORD command during which
>% subject may or may not hit a key.
>WaitSecs(2);
>if (CharAvail)
> disp('A key was pressed.');
> [char, whentick] = GetCharWithTicks;
> RT = whentick-starttick;
> fprintf('Starttick is %0.0f.\n',starttick);
> fprintf('Whentick is %0.0f.\n',whentick);
> fprintf('Reaction Time is %0.0f milliseconds.\n',RT);
> disp('Reaction Time seems to always be 2000 milliseconds.');
>else
> disp('No key was pressed during 2 seconds.');
>end
>
>
>




Wed Dec 18, 2002 5:00 am

ingling7
Offline Offline
Send Email Send Email

Attachment
GetCharWithTicks.zip
Type:
application/x-zip-compressed
Forward
Message #1700 of 10292 |
Expand Messages Author Sort by Date

andy.snyder.wrote ... I've attached a new version of GetCharWithTicks.dll which corrects that problem. I also fixed it to return the same ASCII codes for the...
Allen W. Ingling
ingling7
Offline Send Email
Dec 18, 2002
5:01 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help