Dim theState As SlideState
Set theState = Slide1.States("Default")
Dim strHit As String
Dim theMouseResponseData As MouseResponseData
Dim posMouse As Point
'Loop until mouseclick in a response area occurs
Do
Do Until Mouse.Buttons
Loop
Mouse.GetCursorPos posMouse
strHit = theState.HitTest(posMouse.x, posMouse.y)
Loop Until Left(strHit, 5) = "Image"
'Handle only this click?
If Left(strHit, 5) = "Image" Then
Set theMouseResponseData = CMouseResponseData(Slide1.InputMasks.Responses(1))
End If
Sleep 200
This is the part I am not sure about. I thought that this would tell E-prime to only analyse a response within an image but E-prime returns RT and RTTime data for the first click not the one specified here.
Also unsure if Sleep 200 is too much/enough or in the right spot.
'Define accuracy
If strHit = c.GetAttrib("CorrectAnswer") Then
Slide1.ACC = 1
Else
Slide1.ACC = 0
End If
'Get Image number
If Left(strHit, 5) = "Image" Then
Dim strImgNr As String
strImgNr = Mid$(strHit,6,7)
c.SetAttrib "AnswerSelected", strImgNr
End If
'Define reaction time
Dim Reaction As Long
Reaction = Slide1.RTTime - Slide1.OnsetTime
c.SetAttrib "Reaction", Reaction