2010252<_VersionPersist dt:dt="int">200{E3DBA850-5943-488E-B47A-47529C057CF6}SessionProcTrackMouseCoordinatesPsychology Software Tools, IncAbstract
This sample experiment illustrates how to continuously log mouse
coordinates.
A TextDisplay object is presented and the subject is asked to
estimate the location of a previous stimulus. The TextDisplay is
configured with a 0 Duration so that InLine script will execute during
the object.
The InLine script is a loop that will run until a response is received.
Inside the loop, the current time is constantly monitored. Every
25ms, the mouse coordinates are logged as attributes, along with
a timestamp. Once a response is made, the response coordinates
are logged.
Afterwards, the attributes created are used to present a replay
of the subject's path. A Canvas object is used to draw a circle
representing each set of coordinates logged. An outlined circle
is drawn at the end of the replay to indicate the response
coordinates. The subject can skip this replay by pressing the left
mouse button.{10343DBD-55BE-45C7-AA62-A5239F6918AB}01100212019-05-31T14:21:18.000536870912DisplayDisplay<_VersionPersist dt:dt="int">1-1064048032white1039201NoYes10%SoundSound<_VersionPersist dt:dt="int">100DirectSoundKeyboardKeyboard<_VersionPersist dt:dt="int">1-11001MouseMouse<_VersionPersist dt:dt="int">1-11000-1-10-1BlockTrialSubTrialLogLevel5LogLevel6LogLevel7LogLevel8LogLevel9LogLevel10101SubjectPlease enter the Subject Number (1-32767, 0=No Data Logging):0-1-11032767SessionPlease enter the Session Number (1-32767):0-1-11132767GroupPlease enter Subject's Group (0-32767):0001032767NamePlease enter Subject's Name:100255AgePlease enter Subject's Age (0-150):00000150SexPlease enter Subject's Sex:200malemalefemaleHandednessEnter Subject's Handedness:200leftleftrightResearcherIDPlease enter Researcher's ID:0001032767StimulusSlide{E8D10899-9C8E-4929-ACE6-2D0AF7BC421E}2010273<_VersionPersist dt:dt="int">110OnsetDelay1OnsetTime1DurationError1PreRelease0Duration0StartTime0OffsetTime0FinishTime0TimingMode0CustomOnsetTime0CustomOffsetTime0ActionDelay0ActionTime0TargetOffsetTime0TargetOnsetTime0PendingInputMasks0OffsetDelay0RTTime1ACC1RT1RESP1CRESP1Tag0OnsetToOnsetTime1Defaultwhiteopaqueblack0centercenter100%100%centercenterNoYesSlideTextText1[Color1]whiteopaque0black9%15%8%18%centercentercentercenterCourier New72YesNoNoNo.-1SlideTextText2[Color2]whiteopaque0black24%68%8%18%centercentercentercenterCourier New72YesNoNoNo.-1SlideTextText3[Color3]whiteopaque0black94%5%8%15%centercentercentercenterCourier New72YesNoNoNo.-1SlideTextText4[Color4]whiteopaque0black86%50%8%15%centercentercentercenterCourier New72YesNoNoNo.-15000Default010000DisplayDeviceReplaySlide{71FDCFC0-1B15-40AE-B31A-91199FBF6A7B}2010273<_VersionPersist dt:dt="int">110OnsetDelay1OnsetTime1DurationError1PreRelease0Duration0StartTime0OffsetTime0FinishTime0TimingMode0CustomOnsetTime0CustomOffsetTime0ActionDelay0ActionTime0TargetOffsetTime0TargetOnsetTime0PendingInputMasks0OffsetDelay0RTTime1ACC1RT1RESP1CRESP1Tag0OnsetToOnsetTime1MouseMouseMouse1-11001YesDefaultwhiteopaqueblack0centercenter100%100%centercenterNoYesSlideTextText1[Color1]whiteopaque0black9%15%8%18%centercentercentercenterCourier New72YesNoNoNo.-1SlideTextText2[Color2]whiteopaque0black24%68%8%18%centercentercentercenterCourier New72YesNoNoNo.-1SlideTextText3[Color3]whiteopaque0black94%5%8%15%centercentercentercenterCourier New72YesNoNoNo.-1SlideTextText4[Color4]whiteopaque0black86%50%8%15%centercentercentercenterCourier New72YesNoNoNo.-1SlideTextText5blackwhiteopaque0black319421100%20%centercentercenterbottomCourier New18YesNoNoNoReplaying... click the left mouse button to continue.-100Default010000DisplayDeviceTrialListList{C81B91C4-0AEE-4981-9F0F-795A5ABCD4DF}2010258<_VersionPersist dt:dt="int">5Color11Color21Color31Color41- TrialProc
102000001000Weight17510Nested17511Procedure17512Color10?75188Color20?75188Color30?75188Color40?751881 TrialProc blue red green yellow1 TrialProc magenta silver blue gray1 TrialProc maroon purple olive blueBlockListList{C399E45D-3EE3-4600-8943-A992CEAB2DB2}2010258<_VersionPersist dt:dt="int">5- BlockProc
000000001100Weight17510Nested17511Procedure175121 BlockProcSessionProcProcedure{62E5AEA0-A9CB-43AC-B8E8-261302EAF080}2010254<_VersionPersist dt:dt="int">201- Welcome
- BlockList
- Goodbye
101222WelcomeTextDisplayBlockListListGoodbyeTextDisplayTrialProcProcedure{FA72E951-7B49-4AEC-A7D1-36CA3EA942D5}2010254<_VersionPersist dt:dt="int">201- Fixation
- Stimulus
- ShowMouseCursor
- CollectResponse
- TrackMouse
- HideMouseCursor
- Replay
- DrawPath
- EndTrial
101222FixationTextDisplayStimulusSlideShowMouseCursorInLineCollectResponseTextDisplayTrackMouseInLineHideMouseCursorInLineReplaySlideDrawPathInLineEndTrialLabelBlockProcProcedure{0872FF0E-D69D-4905-BB91-8D7A2FDEDA61}2010254<_VersionPersist dt:dt="int">201- TrialList
101222TrialListListTrackMouseInLine{3EFF6E47-5FA9-4AE0-9277-86077DCD4E11}2010262<_VersionPersist dt:dt="int">1'Declare pointer variable to hold coordinates
Dim ptMouse As Point
'Declare and initialize a variable that will hold the next target time
' to log a coordinate
Dim nLogTime As Long
nLogTime = Clock.Read
'Constant representing the interval at which coordinates will be tracked
Const nInterval As Integer = 25
'Counter variable used to name attributes
Dim nCount As Long
'Loop until a response is made
Do While CollectResponse.InputMasks.IsPending()
'Check if 25ms have passed
If Clock.Read > nLogTime Then
'Increment counter
nCount = nCount + 1
'Get the current mouse cursor position
Mouse.GetCursorPos ptMouse.x, ptMouse.y
'Log the coordinates and the timestamp
c.SetAttrib "XTracked" & nCount, ptMouse.x
c.SetAttrib "YTracked"& nCount, ptmouse.y
c.SetAttrib "TrackTime" & nCount, Clock.Read
'Set the next target log time
nLogTime = nLogTime + nInterval
End If
Loop
'A response has been made, so log response coordinates
Dim theMouseResponseData As MouseResponseData
Set theMouseResponseData = CMouseResponseData(CollectResponse.InputMasks.Responses(1))
If Not theMouseResponseData Is Nothing Then
c.SetAttrib "XTrackedFinal", theMouseResponseData.CursorX
c.SetAttrib "YTrackedFinal", theMouseResponseData.CursorY
c.SetAttrib "TrackTimeFinal", theMouseResponseData.RT
End If
'Release references
Set theMouseResponseData = Nothing
ShowMouseCursorInLine{AB499FAA-E88D-41AF-A142-9C6B439D5852}2010262<_VersionPersist dt:dt="int">1'Set the mouse cursor to the center of the screen
Mouse.SetCursorPos Display.XRes/2, Display.YRes/2
'Show the mouse cursor
Mouse.ShowCursor True
HideMouseCursorInLine{BEBAD6F2-6A43-4D00-8955-420FBA23BC57}2010262<_VersionPersist dt:dt="int">1'Hide the mouse cursor
Mouse.ShowCursor False
DrawPathInLine{10E19A35-9A73-4827-B44E-FB28457ADD6D}2010262<_VersionPersist dt:dt="int">1'Counter variable
Dim nReplayCount As Long
'Constant holding the size of the circles used
' to replay the subject's path
Const nRadius As Integer = 7
'Create and initialize Canvas
Dim cnvsReplay As Canvas
Set cnvsReplay = Display.Canvas
cnvsReplay.PenColor = CColor("silver")
cnvsReplay.FillColor = CColor("silver")
'Replay the subject's response path until the final
' point is reached or a response is received
Do While (nReplayCount < nCount) And (Replay.InputMasks.IsPending())
nReplayCount = nReplayCount + 1
cnvsReplay.Circle c.GetAttrib("XTracked" & nReplayCount), c.GetAttrib("YTracked" & nReplayCount), nRadius
Sleep nInterval
Loop
'Skip if response is received
If Replay.RESP <> "" Then
GoTo EndTrial
End If
'Draw response coordinates
cnvsReplay.PenColor = CColor("black")
cnvsReplay.FillColor = CColor("blue")
cnvsReplay.Circle c.GetAttrib("XTrackedFinal"), c.GetAttrib("YTrackedFinal"), nRadius
'Present feedback
Sleep 1000
WelcomeTextDisplay{BA4D1D7E-507C-440A-9595-B0CBB663B967}2010263<_VersionPersist dt:dt="int">100OnsetDelay0OnsetTime0DurationError0PreRelease0Duration0StartTime0OffsetTime0FinishTime0TimingMode0CustomOnsetTime0CustomOffsetTime0ActionDelay0ActionTime0TargetOffsetTime0TargetOnsetTime0PendingInputMasks0OffsetDelay0RTTime0ACC0RT0RESP0CRESP0Tag0OnsetToOnsetTime0MouseMouseMouse11111Yes-10010blackwhiteopaqueblack0centercenter100%100%centercentercentercenterNoCourier New18YesNoNoNoWelcome to the experiment.
In this task, you will be presented with four dots. You will then be asked to click in the general area that the BLUE dot appeared.
Press the left mouse button to continue.-1000FixationTextDisplay{B09FFD5A-FEAB-4A6A-AD46-66447D702B42}2010263<_VersionPersist dt:dt="int">100OnsetDelay0OnsetTime0DurationError0PreRelease0Duration0StartTime0OffsetTime0FinishTime0TimingMode0CustomOnsetTime0CustomOffsetTime0ActionDelay0ActionTime0TargetOffsetTime0TargetOnsetTime0PendingInputMasks0OffsetDelay0RTTime0ACC0RT0RESP0CRESP0Tag0OnsetToOnsetTime010000010blackwhiteopaqueblack0centercenter100%100%centercentercentercenterNoCourier New18YesNoNoNo+-1000CollectResponseTextDisplay{125ECD7F-F11C-434F-B5C0-C360C38AABEC}2010263<_VersionPersist dt:dt="int">100OnsetDelay0OnsetTime0DurationError0PreRelease0Duration0StartTime0OffsetTime0FinishTime0TimingMode0CustomOnsetTime0CustomOffsetTime0ActionDelay0ActionTime0TargetOffsetTime0TargetOnsetTime0PendingInputMasks0OffsetDelay0RTTime0ACC0RT0RESP0CRESP0Tag0OnsetToOnsetTime0MouseMouseMouse1-11001Yes00010blackwhiteopaqueblack0centercenter100%100%centercentercenterbottomNoCourier New18YesNoNoNoMove the mouse cursor to the position of the blue dot and then press the left mouse button.-1000GoodbyeTextDisplay{7E1E1C2E-97F0-4E6E-BDA8-B587731B2A1B}2010263<_VersionPersist dt:dt="int">100OnsetDelay0OnsetTime0DurationError0PreRelease0Duration0StartTime0OffsetTime0FinishTime0TimingMode0CustomOnsetTime0CustomOffsetTime0ActionDelay0ActionTime0TargetOffsetTime0TargetOnsetTime0PendingInputMasks0OffsetDelay0RTTime0ACC0RT0RESP0CRESP0Tag0OnsetToOnsetTime030000010blackwhiteopaqueblack0centercenter100%100%centercentercentercenterNoCourier New18YesNoNoNoThank you for participating.
Goodbye!-1000EndTrialLabel{8EBA03BC-7B3B-40E6-8786-658F42FE8FD5}2010263<_VersionPersist dt:dt="int">1