how to measure the duration of a key press\ the time of it's release

525 views
Skip to first unread message

Ziv Ronel

unread,
May 29, 2013, 12:27:08 AM5/29/13
to e-p...@googlegroups.com
hello E-prime hive brain, 

I know it's probably dead simple but iv'e been at it for a week now.

i'm doing a study in which random pauses are introduced, in a frustrating matter, and the participants should press keys randomly in an attempt to make the program work. 

i need to measure how many frustrated keypresses there were, at what rate, and for how long each key was down (to measure these long angered key presses). 

I managed to create the first two, but haven't been able to measure duration. 
the only thing that came even close was this piece of code that I wrote:

        Dim theResponseObject As RteRunnableInputObject
Set theResponseObject = CRteRunnableInputObject(Rte.GetObject("Wait1"))

        Debug.Assert Not theResponseObject Is Nothing

Dim KeyReleaseTime As Long
If ebStatePress = 0 Then
KeyReleaseTime =  Clock.ReadMillisec
End If

        c.SetAttrib "KeyPress" & nIndex & "Release", KeyReleaseTime


(there is also a loop in there designed to redo that for every key press made in "wait1", but i've left it out)


HELP!

KatrinH Heimann

unread,
May 29, 2013, 1:52:25 AM5/29/13
to e-p...@googlegroups.com
Hey Ziv,
actually I think you could solve this problem with less programming, telling eprime to also measure key releases, then having an a testslide for two responses (press and release) which registers key pressed and time of release, then you just put an inline saying that if the waiting time has not passed (so the moment of the new slide, randomly calculated beforehand) then go (jump) to end of trial, if it has passed go to the next slide (program responding)
Best
Katrin


2013/5/29 Ziv Ronel <rone...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+u...@googlegroups.com.
To post to this group, send email to e-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/35f3673a-e830-4b58-8d09-51c86d567f19%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ziv Ronel

unread,
May 29, 2013, 6:28:08 AM5/29/13
to e-p...@googlegroups.com
this sounds great, only.. how do I tell E-prime to collect releases? (haven't seen such a thing in the logging or the general options)

David McFarlane

unread,
May 29, 2013, 10:59:16 AM5/29/13
to e-p...@googlegroups.com
For information on using releases, start with the "{key}
nomenclature" topic in the E-Basic Help facility. (Remember that in
general the technical documentation for E-Prime, such as we get any,
is in the E-Basic Help.) You might also look at the "Key Release"
example that you may download from the PST website.

Note, of course, that you may have to completely rethink your
programmning approach in order to make the best use of the release facility.

(BTW, in future replies could you please include all the replies from
others in addition to your own posts? That would make it easier for
others to follow the thread. Thanks.)

-----
David McFarlane
E-Prime training
online: http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter: @EPrimeMaster (https://twitter.com/EPrimeMaster)

/----
Stock reminder: 1) I do not work for PST. 2) PST's trained staff
take any and all questions at
http://support.pstnet.com/e%2Dprime/support/login.asp , and they
strive to respond to all requests in 24-48 hours, so make full use of
it. 3) In addition, PST offers several instructional videos on their
YouTube channel (http://www.youtube.com/user/PSTNET ). 4) If you do
get an answer from PST staff, please extend the courtesy of posting
their reply back here for the sake of others.
\----
Reply all
Reply to author
Forward
0 new messages