Problem with logging keyboard responses


Author
Message
DRNVC
DRNVC
Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)
Group: Forum Members
Posts: 3, Visits: 1

Thanks, much appreciated. I have pasted in the code for the trial below just in case it helps anyone else. 



<trial image 1>


/ stimulustimes = [0=image1Pic; 1000=erase]


/ trialduration = values.exposureDuration


/ inputdevice=keyboard


/ responsetime = 0


/ responseinterrupt = trial


/ validresponse = (" ")


</trial>


Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K

See the documentation for the <trial> element's /responseinterrupt attribute. You need to change the setting.


DRNVC
DRNVC
Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)
Group: Forum Members
Posts: 3, Visits: 1

Hi, 


Thanks. I tried adding " / responsetime = 0" to each trial, so that it now records inputs from the beginning of each trial. This means that the code for each trial now looks like this:


<trial image 1>


/ stimulustimes = [0=image1Pic; 1000=erase]


/ trialduration = values.exposureDuration


/ inputdevice=keyboard


/ responsetime = 0


/ validresponse = (" ")


</trial>



The new problem now is that if I press space during a trial it interferes with that trial and cuts off the trial to move on to the next one. I don't want there to be a 'correct' response in the sense that it actually impacts in any way with how the images are presented. Instead I simply want to log whether the space bar is pressed during the trial. Whether it is pressed or not should not affect the way that images are presented. 


Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K

Be mindful of the fact that a <trial> *only collects a single response*. Since your trials have a fixed /duration, any response made after the initial key press during a given trial will not be logged. Also, since you have not specified the /responsetime, <trial target> will only start accepting a response after 101ms, <trial image1> only after 1000ms.


It is not possible to deduce more based on the code snippets you posted.


DRNVC
DRNVC
Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)Associate Member (154 reputation)
Group: Forum Members
Posts: 3, Visits: 1

I am conducting a task in which I show people a series of different images. During the series of images, at random points, a white circle appears suddenly and people have to press the space bar as quickly as possible to register that they have seen the circle.


I am simply interested in whether people have bothered to press the space bar, either straight away or in the next few seconds after a circle flashes up. So in essence, I just want to log the times at which they press the space bar. 


I have separate trials for each of the series of images, plus a trial for the target (the white circle). 


These look like this (the first relates to the white circle, the second is representative of all of the image trials but the code is essentially the same for all of the images used):


<trial target>


/ stimulustimes = [0=targetPic; 101=erase]


/ trialduration = values.targetDuration


/ inputdevice=keyboard


/ validresponse = (" ")


</trial>



<trial image 1>


/ stimulustimes = [0=image1Pic; 1000=erase]


/ trialduration = values.exposureDuration


/ inputdevice=keyboard


/ validresponse = (" ")


</trial>



My problem is that this only seems to record a very few instances of the space bar being pressed rather than all of the keyboard presses that I make. For example, I went through the whole task and pressed the space bar at 12 different points (making sure these were in separate trials), and when I looked at the raw data, there were only two presses of the space bar that had been registered (i.e. response column in the raw data showed '57' rather than '0'). Is there any reason why this might be? I don't think it is a problem with my space bar as I am not having any problems at all in any other program. 


Many thanks




GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search