﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 4  » Count number of key presses during video presentation?</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Mon, 14 Sep 2026 15:09:27 GMT</lastBuildDate><ttl>20</ttl><item><title>Count number of key presses during video presentation?</title><link>https://forums.millisecond.com/Topic16749.aspx</link><description>I would like to play a video and count the number of times that a participant presses a key (e.g., spacebar) during the video presentation. During the video they will be searching for objects, and each time they see it they will press the key. I have loaded the video into the inquisit script, but I cannot figure out how to record the data such that I have this count. Any advice on code for this?&lt;br/&gt;I've read through the tutorials, but this is my first time conducting a study with inquisit so there are many things I am still learning.&lt;br/&gt;Thanks in advance for any help!</description><pubDate>Tue, 21 Jul 2015 07:45:06 GMT</pubDate><dc:creator>inq778</dc:creator></item><item><title>RE: Count number of key presses during video presentation?</title><link>https://forums.millisecond.com/Topic16753.aspx</link><description>Great, thank you so much!</description><pubDate>Tue, 21 Jul 2015 07:45:06 GMT</pubDate><dc:creator>inq778</dc:creator></item><item><title>RE: Count number of key presses during video presentation?</title><link>https://forums.millisecond.com/Topic16752.aspx</link><description>Here's a simple, self-contained example for the 2nd (more complicated) option using /isvalidresponse:&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ spacebarpresscount = 0&lt;br/&gt;/ latencies = ""&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block myblock&amp;gt;&lt;br/&gt;/ trials = [1-2=mytrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial mytrial&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.spacebarpresscount=0; values.latencies=""; ]&lt;br/&gt;/ stimulusframes = [1=mytext]&lt;br/&gt;/ trialduration = 5000&lt;br/&gt;/ validresponse = (57)&lt;br/&gt;/ isvalidresponse = [if(trial.mytrial.response==57){values.spacebarpresscount += 1; values.latencies=concat(concat(values.latencies, trial.mytrial.latency),","); false}; ]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text mytext&amp;gt;&lt;br/&gt;/ items = ("Imagine a video being played...", "Imagine another video being played")&lt;br/&gt;/ select = sequence&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;data&amp;gt;&lt;br/&gt;/ columns = [date time subject group blocknum blockcode trialnum trialcode response latency values.spacebarpresscount values.latencies]&lt;br/&gt;/ separatefiles = true&lt;br/&gt;&amp;lt;/data&amp;gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Mon, 20 Jul 2015 18:12:52 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Count number of key presses during video presentation?</title><link>https://forums.millisecond.com/Topic16751.aspx</link><description>You have essentially two options to do that. See &lt;a href="https://www.millisecond.com/forums/FindPost16437.aspx"&gt;https://www.millisecond.com/forums/FindPost16437.aspx&lt;/a&gt; &lt;br/&gt;</description><pubDate>Mon, 20 Jul 2015 18:00:11 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>