﻿<?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 5  » Questions Approach-Avoidance Task: keypress</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Sun, 20 Sep 2026 16:04:37 GMT</lastBuildDate><ttl>20</ttl><item><title>Questions Approach-Avoidance Task: keypress</title><link>https://forums.millisecond.com/Topic26524.aspx</link><description>Hi,&lt;br/&gt;&lt;br/&gt;is it possible to combine the AAT with keypress as response device instead of the joystick or mouse? And if so, how can I ensure that the keypress is linked to the zoom effect such that if the key is pressed, the picture increases/decreases and if the key press is stopped the movement of the Picture is&amp;nbsp;also stopped?&lt;br/&gt;&lt;br/&gt;Best&lt;br/&gt;Charlotte&lt;br/&gt;</description><pubDate>Fri, 08 Mar 2019 10:13:26 GMT</pubDate><dc:creator>charlotte.w</dc:creator></item><item><title>RE: Questions Approach-Avoidance Task: keypress</title><link>https://forums.millisecond.com/Topic26539.aspx</link><description>&lt;div data-id="26538" class="if-quote-wrapper" unselectable="on" data-guid="1552068777654"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="26538" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="26538" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="26538" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - Friday, March 8, 2019&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-26538"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="26536" class="if-quote-wrapper" unselectable="on" data-guid="1552068777654"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="26536" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="26536" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="26536" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;charlotte.w - Friday, March 8, 2019&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-26536"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="26525" class="if-quote-wrapper" unselectable="on" data-guid="1552068777654"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="26525" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="26525" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="26525" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - Tuesday, March 5, 2019&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-26525"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="26524" class="if-quote-wrapper" unselectable="on" data-guid="1552068777654"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="26524" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="26524" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="26524" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;charlotte.w - Tuesday, March 5, 2019&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-26524"&gt;&lt;div class="if-quote-message-margin"&gt;Hi,&lt;br/&gt;&lt;br/&gt;is it possible to combine the AAT with keypress as response device instead of the joystick or mouse? And if so, how can I ensure that the keypress is linked to the zoom effect such that if the key is pressed, the picture increases/decreases and if the key press is stopped the movement of the Picture is&amp;nbsp;also stopped?&lt;br/&gt;&lt;br/&gt;Best&lt;br/&gt;Charlotte&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="26524"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;It's possible, but you'll have to make some extensive modifications to the script. When a given key is pressed, you'll want to start the zoom in or zoom out sequence, depending on which key was pressed. You'll have to decide on some fixed time and size change for each zoom step, and those &amp;lt;trial&amp;gt; elements ought to be set up to detect a key release and then stop the sequence accordingly. When you're working with a regular keyboard, keys are identified by their respective keyboard scan code (see Tools -&amp;gt; Keyboard Scancodes...). A key release is specified by prepending a minus sign to the respective scan code, i.e.&lt;br/&gt;&lt;br/&gt;&amp;lt;trial press&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ validresponse = (57)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;would detect a press on the space bar, while&lt;br/&gt;&lt;br/&gt;&amp;lt;trial release&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ validresponse = (-57)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;would detect the space bar's release.&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="26525"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;thanks for your reply. Probably, the following code would have to be changed?&lt;br/&gt;&amp;lt;trial AAT_4&amp;gt;&lt;br/&gt;/inputdevice = mouse&lt;br/&gt;/ ontrialbegin = [values.selectstimulus = list.category4.nextvalue]&lt;br/&gt;/ ontrialbegin = [values.targetcategory = 2; values.targetformat = "p"]&lt;br/&gt;/ ontrialbegin = [picture.targetstimulus.height = values.startheight_B]&lt;br/&gt;&lt;br/&gt;/ ontrialbegin = [values.starttime = script.elapsedtime; values.endtime = 0]&lt;br/&gt;/ ontrialbegin = [values.completeRT = 0; values.changedirection = 0; values.finalresponse=""]&lt;br/&gt;&lt;br/&gt;/ stimulusframes = [1 = targetstimulus]&lt;br/&gt;/ validresponse = (mousemove)&lt;br/&gt;/isvalidresponse = [(trial.AAT_4.responsey &amp;gt; (values.mouse_y + values.pixeltolerance)) ||&lt;br/&gt;(trial.AAT_4.responsey &amp;lt; (values.mouse_y - values.pixeltolerance)) ]&lt;br/&gt;/ iscorrectresponse = [(values.expcondition == 1 &amp;amp;&amp;amp; trial.AAT_4.responsey &amp;gt; values.mouse_y) ||&lt;br/&gt;(values.expcondition == 2 &amp;amp;&amp;amp; trial.AAT_4.responsey &amp;lt; values.mouse_y)]&lt;br/&gt;&lt;br/&gt;/ errormessage = true(error,500)&lt;br/&gt;/ontrialend = [if (trial.AAT_4.responsey &amp;lt; values.mouse_y) values.response = 1 else values.response = 2]&lt;br/&gt;/ ontrialend = [values.mouse_change = abs(values.mouse_y - trial.AAT_4.responsey)]&lt;br/&gt;/ ontrialend = [values.mouse_y = trial.AAT_4.responsey]&lt;br/&gt;&lt;br/&gt;/ ontrialend = [if (trial.AAT_4.correct) values.sumRTcorrect_4 += trial.AAT_4.latency]&lt;br/&gt;/ ontrialend = [values.sumRT_4 += trial.AAT_4.latency]&lt;br/&gt;&lt;br/&gt;/ ontrialend = [values.trialcode = "AAT_4"]&lt;br/&gt;/ ontrialend = [values.RT = trial.AAT_4.latency]&lt;br/&gt;/ ontrialend = [values.correct = trial.AAT_4.correct]&lt;br/&gt;/ ontrialend = [values.stimulus = picture.targetstimulus.currentitem]&lt;br/&gt;&lt;br/&gt;/ontrialend = [if (values.response == 1) values.initialresponse = "PUSH"&lt;br/&gt;else values.initialresponse = "PULL"]&lt;br/&gt;&lt;br/&gt;/ branch = [if (values.response == 1) trial.decrease else trial.increase]&lt;br/&gt;/recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;And for the change of picture size: &lt;br/&gt;&amp;lt;trial decrease&amp;gt;&lt;br/&gt;/inputdevice = mouse&lt;br/&gt;/ ontrialbegin = [picture.targetstimulus.height = picture.targetstimulus.height - values.mouse_change/(values.maxheight/2) * expressions.maxheightchange_px]&lt;br/&gt;&lt;br/&gt;/ stimulusframes = [1 = eraser, targetstimulus]&lt;br/&gt;/validresponse = (mousemove)&lt;br/&gt;/ontrialend = [values.mouse_change = abs(values.mouse_y - trial.decrease.responsey)]&lt;br/&gt;&lt;br/&gt;/ontrialend = [trial.decrease.resetstimulusframes()]&lt;br/&gt;&lt;br/&gt;/branch = [if (script.subjectid == "monkey") {values.endtime = script.elapsedtime; values.finalresponse = "PUSH"; trial.intertrialinterval}]&lt;br/&gt;&lt;br/&gt;/branch = [if (trial.decrease.responsey &amp;lt;= 1) &lt;br/&gt;{if( 1 == values.targetcategory) {values.mouse_y = trial.decrease.responsey; values.endtime = script.elapsedtime; values.finalresponse = "PUSH"; trial.enddecrease} else { trial.maxdecrease }}]&lt;br/&gt;/branch = [if (trial.decrease.responsey &amp;lt;= values.mouse_y) &lt;br/&gt;{values.mouse_y = trial.decrease.responsey; trial.decrease}]&lt;br/&gt;/branch = [if (trial.decrease.responsey &amp;gt; values.mouse_y) &lt;br/&gt;{values.mouse_y = trial.decrease.responsey; values.changedirection += 1; trial.increase}]&lt;br/&gt;&lt;br/&gt;/ recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial maxdecrease&amp;gt;&lt;br/&gt;/inputdevice = mouse&lt;br/&gt;/ontrialbegin = [picture.targetstimulus.height = picture.targetstimulus.height + values.mouse_change/(values.maxheight/2) * expressions.maxheightchange_px]&lt;br/&gt;/stimulusframes = [1 = targetstimulus, hint_please_pull]&lt;br/&gt;/validresponse = (mousemove)&lt;br/&gt;/isvalidresponse = [trial.maxdecrease.responsey &amp;gt; values.mouse_y]&lt;br/&gt;/ontrialend = [values.mouse_change = abs(values.mouse_y - trial.maxdecrease.responsey); values.mouse_y = trial.maxdecrease.responsey; trial.maxdecrease.resetstimulusframes()]&lt;br/&gt;/branch = [trial.increase]&lt;br/&gt;/recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial enddecrease&amp;gt;&lt;br/&gt;/ontrialbegin = [picture.targetstimulus.height = picture.targetstimulus.height - values.mouse_change/(values.maxheight/2) * expressions.maxheightchange_px]&lt;br/&gt;/stimulusframes = [1 = eraser, targetstimulus]&lt;br/&gt;/timeout = 0&lt;br/&gt;/branch = [trial.intertrialinterval]&lt;br/&gt;/recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;But I have no idea how this could be changed according to key press. How would you combine the key press with the size of the picture? Duration of key press?&lt;br/&gt;&lt;br/&gt;Best&lt;br/&gt;Charlotte&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="26536"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;From the trial that takes the intitial key press, you need to /branch to the trial that increases or decreases size respectively.&lt;br/&gt;&lt;br/&gt;Those latter trials, you need to give a fixed duration and each instance of that trial needs to in- or decrease the size by a fixed amount you need to decide on.&lt;br/&gt;&lt;br/&gt;Those trials you need to set up to detect key releases. If no response / no release is detected in those trials, they ought to just keep /branch'ing to themselves until the maximum (or minimum, respectively) size is reached.&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="26538"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Here's a simplifies example to illustrate:&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ height = 0px&lt;br/&gt;/ width = 0px&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text stimulus&amp;gt;&lt;br/&gt;/ items = (" ")&lt;br/&gt;/ size = (values.width, values.height)&lt;br/&gt;/ erase = false&lt;br/&gt;/ txbgcolor = blue&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial start&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;values.height = 0.5px*display.canvasheight;&lt;br/&gt;values.width = 0.5*display.canvasheight;&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [1=clearscreen, stimulus]&lt;br/&gt;/ validresponse = (200, 208)&lt;br/&gt;/ branch = [&lt;br/&gt;if(trial.start.response == 200) trial.increase else trial.decrease&lt;br/&gt;]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial increase&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;values.height += 10px;&lt;br/&gt;values.width += 10px;&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [1=clearscreen, stimulus]&lt;br/&gt;/ validresponse = (-200, 208, 0)&lt;br/&gt;/ timeout = 100&lt;br/&gt;/ branch = [&lt;br/&gt;if(values.height &amp;gt;= display.canvasheight - 10) {&lt;br/&gt;trial.endincrease;&lt;br/&gt;}&lt;br/&gt;]&lt;br/&gt;/ branch = [&lt;br/&gt;if(trial.increase.response == 0) {&lt;br/&gt;trial.increase;&lt;br/&gt;} else if (trial.increase.response == -200) {&lt;br/&gt;trial.pause;&lt;br/&gt;} else if (trial.increase.response == 208) {&lt;br/&gt;trial.decrease;&lt;br/&gt;}&lt;br/&gt;]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial decrease&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;values.height -= 10px;&lt;br/&gt;values.width -= 10px;&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [1=clearscreen, stimulus]&lt;br/&gt;/ validresponse = (-208, 200, 0)&lt;br/&gt;/ timeout = 100&lt;br/&gt;/ branch = [&lt;br/&gt;if(values.height &amp;lt;= 10) {&lt;br/&gt;trial.enddecrease;&lt;br/&gt;}&lt;br/&gt;]&lt;br/&gt;/ branch = [&lt;br/&gt;if(trial.decrease.response == 0) {&lt;br/&gt;trial.decrease;&lt;br/&gt;} else if (trial.decrease.response == -208) {&lt;br/&gt;trial.pause;&lt;br/&gt;} else if (trial.decrease.response == 200) {&lt;br/&gt;trial.increase;&lt;br/&gt;}&lt;br/&gt;]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial pause&amp;gt;&lt;br/&gt;/ stimulusframes = [1=clearscreen, stimulus]&lt;br/&gt;/ validresponse = (200, 208)&lt;br/&gt;/ branch = [&lt;br/&gt;if(trial.pause.response == 200) trial.increase else trial.decrease&lt;br/&gt;]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial endincrease&amp;gt;&lt;br/&gt;/ stimulusframes = [1=clearscreen, stimulus]&lt;br/&gt;/ validresponse = (0)&lt;br/&gt;/ trialduration = 500&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial enddecrease&amp;gt;&lt;br/&gt;/ stimulusframes = [1=clearscreen, stimulus]&lt;br/&gt;/ validresponse = (0)&lt;br/&gt;/ trialduration = 500&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block example&amp;gt;&lt;br/&gt;/ trials = [1-4=start;]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;Press the UP arrow key on your keyboard to increase size, use the DOWN arrow key to decrease size.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Fri, 08 Mar 2019 10:13:26 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Questions Approach-Avoidance Task: keypress</title><link>https://forums.millisecond.com/Topic26538.aspx</link><description>&lt;div data-id="26536" class="if-quote-wrapper" unselectable="on" data-guid="1552067176335"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="26536" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="26536" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="26536" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;charlotte.w - Friday, March 8, 2019&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-26536"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="26525" class="if-quote-wrapper" unselectable="on" data-guid="1552067176335"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="26525" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="26525" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="26525" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - Tuesday, March 5, 2019&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-26525"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="26524" class="if-quote-wrapper" unselectable="on" data-guid="1552067176335"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="26524" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="26524" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="26524" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;charlotte.w - Tuesday, March 5, 2019&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-26524"&gt;&lt;div class="if-quote-message-margin"&gt;Hi,&lt;br/&gt;&lt;br/&gt;is it possible to combine the AAT with keypress as response device instead of the joystick or mouse? And if so, how can I ensure that the keypress is linked to the zoom effect such that if the key is pressed, the picture increases/decreases and if the key press is stopped the movement of the Picture is&amp;nbsp;also stopped?&lt;br/&gt;&lt;br/&gt;Best&lt;br/&gt;Charlotte&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="26524"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;It's possible, but you'll have to make some extensive modifications to the script. When a given key is pressed, you'll want to start the zoom in or zoom out sequence, depending on which key was pressed. You'll have to decide on some fixed time and size change for each zoom step, and those &amp;lt;trial&amp;gt; elements ought to be set up to detect a key release and then stop the sequence accordingly. When you're working with a regular keyboard, keys are identified by their respective keyboard scan code (see Tools -&amp;gt; Keyboard Scancodes...). A key release is specified by prepending a minus sign to the respective scan code, i.e.&lt;br/&gt;&lt;br/&gt;&amp;lt;trial press&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ validresponse = (57)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;would detect a press on the space bar, while&lt;br/&gt;&lt;br/&gt;&amp;lt;trial release&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ validresponse = (-57)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;would detect the space bar's release.&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="26525"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;thanks for your reply. Probably, the following code would have to be changed?&lt;br/&gt;&amp;lt;trial AAT_4&amp;gt;&lt;br/&gt;/inputdevice = mouse&lt;br/&gt;/ ontrialbegin = [values.selectstimulus = list.category4.nextvalue]&lt;br/&gt;/ ontrialbegin = [values.targetcategory = 2; values.targetformat = "p"]&lt;br/&gt;/ ontrialbegin = [picture.targetstimulus.height = values.startheight_B]&lt;br/&gt;&lt;br/&gt;/ ontrialbegin = [values.starttime = script.elapsedtime; values.endtime = 0]&lt;br/&gt;/ ontrialbegin = [values.completeRT = 0; values.changedirection = 0; values.finalresponse=""]&lt;br/&gt;&lt;br/&gt;/ stimulusframes = [1 = targetstimulus]&lt;br/&gt;/ validresponse = (mousemove)&lt;br/&gt;/isvalidresponse = [(trial.AAT_4.responsey &amp;gt; (values.mouse_y + values.pixeltolerance)) ||&lt;br/&gt;(trial.AAT_4.responsey &amp;lt; (values.mouse_y - values.pixeltolerance)) ]&lt;br/&gt;/ iscorrectresponse = [(values.expcondition == 1 &amp;amp;&amp;amp; trial.AAT_4.responsey &amp;gt; values.mouse_y) ||&lt;br/&gt;(values.expcondition == 2 &amp;amp;&amp;amp; trial.AAT_4.responsey &amp;lt; values.mouse_y)]&lt;br/&gt;&lt;br/&gt;/ errormessage = true(error,500)&lt;br/&gt;/ontrialend = [if (trial.AAT_4.responsey &amp;lt; values.mouse_y) values.response = 1 else values.response = 2]&lt;br/&gt;/ ontrialend = [values.mouse_change = abs(values.mouse_y - trial.AAT_4.responsey)]&lt;br/&gt;/ ontrialend = [values.mouse_y = trial.AAT_4.responsey]&lt;br/&gt;&lt;br/&gt;/ ontrialend = [if (trial.AAT_4.correct) values.sumRTcorrect_4 += trial.AAT_4.latency]&lt;br/&gt;/ ontrialend = [values.sumRT_4 += trial.AAT_4.latency]&lt;br/&gt;&lt;br/&gt;/ ontrialend = [values.trialcode = "AAT_4"]&lt;br/&gt;/ ontrialend = [values.RT = trial.AAT_4.latency]&lt;br/&gt;/ ontrialend = [values.correct = trial.AAT_4.correct]&lt;br/&gt;/ ontrialend = [values.stimulus = picture.targetstimulus.currentitem]&lt;br/&gt;&lt;br/&gt;/ontrialend = [if (values.response == 1) values.initialresponse = "PUSH"&lt;br/&gt;else values.initialresponse = "PULL"]&lt;br/&gt;&lt;br/&gt;/ branch = [if (values.response == 1) trial.decrease else trial.increase]&lt;br/&gt;/recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;And for the change of picture size: &lt;br/&gt;&amp;lt;trial decrease&amp;gt;&lt;br/&gt;/inputdevice = mouse&lt;br/&gt;/ ontrialbegin = [picture.targetstimulus.height = picture.targetstimulus.height - values.mouse_change/(values.maxheight/2) * expressions.maxheightchange_px]&lt;br/&gt;&lt;br/&gt;/ stimulusframes = [1 = eraser, targetstimulus]&lt;br/&gt;/validresponse = (mousemove)&lt;br/&gt;/ontrialend = [values.mouse_change = abs(values.mouse_y - trial.decrease.responsey)]&lt;br/&gt;&lt;br/&gt;/ontrialend = [trial.decrease.resetstimulusframes()]&lt;br/&gt;&lt;br/&gt;/branch = [if (script.subjectid == "monkey") {values.endtime = script.elapsedtime; values.finalresponse = "PUSH"; trial.intertrialinterval}]&lt;br/&gt;&lt;br/&gt;/branch = [if (trial.decrease.responsey &amp;lt;= 1) &lt;br/&gt;{if( 1 == values.targetcategory) {values.mouse_y = trial.decrease.responsey; values.endtime = script.elapsedtime; values.finalresponse = "PUSH"; trial.enddecrease} else { trial.maxdecrease }}]&lt;br/&gt;/branch = [if (trial.decrease.responsey &amp;lt;= values.mouse_y) &lt;br/&gt;{values.mouse_y = trial.decrease.responsey; trial.decrease}]&lt;br/&gt;/branch = [if (trial.decrease.responsey &amp;gt; values.mouse_y) &lt;br/&gt;{values.mouse_y = trial.decrease.responsey; values.changedirection += 1; trial.increase}]&lt;br/&gt;&lt;br/&gt;/ recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial maxdecrease&amp;gt;&lt;br/&gt;/inputdevice = mouse&lt;br/&gt;/ontrialbegin = [picture.targetstimulus.height = picture.targetstimulus.height + values.mouse_change/(values.maxheight/2) * expressions.maxheightchange_px]&lt;br/&gt;/stimulusframes = [1 = targetstimulus, hint_please_pull]&lt;br/&gt;/validresponse = (mousemove)&lt;br/&gt;/isvalidresponse = [trial.maxdecrease.responsey &amp;gt; values.mouse_y]&lt;br/&gt;/ontrialend = [values.mouse_change = abs(values.mouse_y - trial.maxdecrease.responsey); values.mouse_y = trial.maxdecrease.responsey; trial.maxdecrease.resetstimulusframes()]&lt;br/&gt;/branch = [trial.increase]&lt;br/&gt;/recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial enddecrease&amp;gt;&lt;br/&gt;/ontrialbegin = [picture.targetstimulus.height = picture.targetstimulus.height - values.mouse_change/(values.maxheight/2) * expressions.maxheightchange_px]&lt;br/&gt;/stimulusframes = [1 = eraser, targetstimulus]&lt;br/&gt;/timeout = 0&lt;br/&gt;/branch = [trial.intertrialinterval]&lt;br/&gt;/recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;But I have no idea how this could be changed according to key press. How would you combine the key press with the size of the picture? Duration of key press?&lt;br/&gt;&lt;br/&gt;Best&lt;br/&gt;Charlotte&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="26536"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;From the trial that takes the intitial key press, you need to /branch to the trial that increases or decreases size respectively.&lt;br/&gt;&lt;br/&gt;Those latter trials, you need to give a fixed duration and each instance of that trial needs to in- or decrease the size by a fixed amount you need to decide on.&lt;br/&gt;&lt;br/&gt;Those trials you need to set up to detect key releases. If no response / no release is detected in those trials, they ought to just keep /branch'ing to themselves until the maximum (or minimum, respectively) size is reached.&lt;br/&gt;</description><pubDate>Fri, 08 Mar 2019 09:49:41 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Questions Approach-Avoidance Task: keypress</title><link>https://forums.millisecond.com/Topic26536.aspx</link><description>&lt;div data-id="26525" class="if-quote-wrapper" unselectable="on" data-guid="1552057836772"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="26525" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="26525" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="26525" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - Tuesday, March 5, 2019&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-26525"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="26524" class="if-quote-wrapper" unselectable="on" data-guid="1552057836772"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="26524" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="26524" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="26524" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;charlotte.w - Tuesday, March 5, 2019&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-26524"&gt;&lt;div class="if-quote-message-margin"&gt;Hi,&lt;br/&gt;&lt;br/&gt;is it possible to combine the AAT with keypress as response device instead of the joystick or mouse? And if so, how can I ensure that the keypress is linked to the zoom effect such that if the key is pressed, the picture increases/decreases and if the key press is stopped the movement of the Picture is&amp;nbsp;also stopped?&lt;br/&gt;&lt;br/&gt;Best&lt;br/&gt;Charlotte&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="26524"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;It's possible, but you'll have to make some extensive modifications to the script. When a given key is pressed, you'll want to start the zoom in or zoom out sequence, depending on which key was pressed. You'll have to decide on some fixed time and size change for each zoom step, and those &amp;lt;trial&amp;gt; elements ought to be set up to detect a key release and then stop the sequence accordingly. When you're working with a regular keyboard, keys are identified by their respective keyboard scan code (see Tools -&amp;gt; Keyboard Scancodes...). A key release is specified by prepending a minus sign to the respective scan code, i.e.&lt;br/&gt;&lt;br/&gt;&amp;lt;trial press&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ validresponse = (57)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;would detect a press on the space bar, while&lt;br/&gt;&lt;br/&gt;&amp;lt;trial release&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ validresponse = (-57)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;would detect the space bar's release.&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="26525"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;thanks for your reply. Probably, the following code would have to be changed?&lt;br/&gt;&amp;lt;trial AAT_4&amp;gt;&lt;br/&gt;/inputdevice = mouse&lt;br/&gt;/ ontrialbegin = [values.selectstimulus = list.category4.nextvalue]&lt;br/&gt;/ ontrialbegin = [values.targetcategory = 2; values.targetformat = "p"]&lt;br/&gt;/ ontrialbegin = [picture.targetstimulus.height = values.startheight_B]&lt;br/&gt;&lt;br/&gt;/ ontrialbegin = [values.starttime = script.elapsedtime; values.endtime = 0]&lt;br/&gt;/ ontrialbegin = [values.completeRT = 0; values.changedirection = 0; values.finalresponse=""]&lt;br/&gt;&lt;br/&gt;/ stimulusframes = [1 = targetstimulus]&lt;br/&gt;/ validresponse = (mousemove)&lt;br/&gt;/isvalidresponse = [(trial.AAT_4.responsey &amp;gt; (values.mouse_y + values.pixeltolerance)) ||&lt;br/&gt;(trial.AAT_4.responsey &amp;lt; (values.mouse_y - values.pixeltolerance)) ]&lt;br/&gt;/ iscorrectresponse = [(values.expcondition == 1 &amp;amp;&amp;amp; trial.AAT_4.responsey &amp;gt; values.mouse_y) ||&lt;br/&gt;(values.expcondition == 2 &amp;amp;&amp;amp; trial.AAT_4.responsey &amp;lt; values.mouse_y)]&lt;br/&gt;&lt;br/&gt;/ errormessage = true(error,500)&lt;br/&gt;/ontrialend = [if (trial.AAT_4.responsey &amp;lt; values.mouse_y) values.response = 1 else values.response = 2]&lt;br/&gt;/ ontrialend = [values.mouse_change = abs(values.mouse_y - trial.AAT_4.responsey)]&lt;br/&gt;/ ontrialend = [values.mouse_y = trial.AAT_4.responsey]&lt;br/&gt;&lt;br/&gt;/ ontrialend = [if (trial.AAT_4.correct) values.sumRTcorrect_4 += trial.AAT_4.latency]&lt;br/&gt;/ ontrialend = [values.sumRT_4 += trial.AAT_4.latency]&lt;br/&gt;&lt;br/&gt;/ ontrialend = [values.trialcode = "AAT_4"]&lt;br/&gt;/ ontrialend = [values.RT = trial.AAT_4.latency]&lt;br/&gt;/ ontrialend = [values.correct = trial.AAT_4.correct]&lt;br/&gt;/ ontrialend = [values.stimulus = picture.targetstimulus.currentitem]&lt;br/&gt;&lt;br/&gt;/ontrialend = [if (values.response == 1) values.initialresponse = "PUSH"&lt;br/&gt;else values.initialresponse = "PULL"]&lt;br/&gt;&lt;br/&gt;/ branch = [if (values.response == 1) trial.decrease else trial.increase]&lt;br/&gt;/recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;And for the change of picture size: &lt;br/&gt;&amp;lt;trial decrease&amp;gt;&lt;br/&gt;/inputdevice = mouse&lt;br/&gt;/ ontrialbegin = [picture.targetstimulus.height = picture.targetstimulus.height - values.mouse_change/(values.maxheight/2) * expressions.maxheightchange_px]&lt;br/&gt;&lt;br/&gt;/ stimulusframes = [1 = eraser, targetstimulus]&lt;br/&gt;/validresponse = (mousemove)&lt;br/&gt;/ontrialend = [values.mouse_change = abs(values.mouse_y - trial.decrease.responsey)]&lt;br/&gt;&lt;br/&gt;/ontrialend = [trial.decrease.resetstimulusframes()]&lt;br/&gt;&lt;br/&gt;/branch = [if (script.subjectid == "monkey") {values.endtime = script.elapsedtime; values.finalresponse = "PUSH"; trial.intertrialinterval}]&lt;br/&gt;&lt;br/&gt;/branch = [if (trial.decrease.responsey &amp;lt;= 1) &lt;br/&gt;{if( 1 == values.targetcategory) {values.mouse_y = trial.decrease.responsey; values.endtime = script.elapsedtime; values.finalresponse = "PUSH"; trial.enddecrease} else { trial.maxdecrease }}]&lt;br/&gt;/branch = [if (trial.decrease.responsey &amp;lt;= values.mouse_y) &lt;br/&gt;{values.mouse_y = trial.decrease.responsey; trial.decrease}]&lt;br/&gt;/branch = [if (trial.decrease.responsey &amp;gt; values.mouse_y) &lt;br/&gt;{values.mouse_y = trial.decrease.responsey; values.changedirection += 1; trial.increase}]&lt;br/&gt;&lt;br/&gt;/ recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial maxdecrease&amp;gt;&lt;br/&gt;/inputdevice = mouse&lt;br/&gt;/ontrialbegin = [picture.targetstimulus.height = picture.targetstimulus.height + values.mouse_change/(values.maxheight/2) * expressions.maxheightchange_px]&lt;br/&gt;/stimulusframes = [1 = targetstimulus, hint_please_pull]&lt;br/&gt;/validresponse = (mousemove)&lt;br/&gt;/isvalidresponse = [trial.maxdecrease.responsey &amp;gt; values.mouse_y]&lt;br/&gt;/ontrialend = [values.mouse_change = abs(values.mouse_y - trial.maxdecrease.responsey); values.mouse_y = trial.maxdecrease.responsey; trial.maxdecrease.resetstimulusframes()]&lt;br/&gt;/branch = [trial.increase]&lt;br/&gt;/recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial enddecrease&amp;gt;&lt;br/&gt;/ontrialbegin = [picture.targetstimulus.height = picture.targetstimulus.height - values.mouse_change/(values.maxheight/2) * expressions.maxheightchange_px]&lt;br/&gt;/stimulusframes = [1 = eraser, targetstimulus]&lt;br/&gt;/timeout = 0&lt;br/&gt;/branch = [trial.intertrialinterval]&lt;br/&gt;/recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;But I have no idea how this could be changed according to key press. How would you combine the key press with the size of the picture? Duration of key press?&lt;br/&gt;&lt;br/&gt;Best&lt;br/&gt;Charlotte&lt;br/&gt;</description><pubDate>Fri, 08 Mar 2019 07:14:01 GMT</pubDate><dc:creator>charlotte.w</dc:creator></item><item><title>RE: Questions Approach-Avoidance Task: keypress</title><link>https://forums.millisecond.com/Topic26525.aspx</link><description>&lt;div data-id="26524" class="if-quote-wrapper" unselectable="on" data-guid="1551805247999"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="26524" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="26524" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="26524" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;charlotte.w - Tuesday, March 5, 2019&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-26524"&gt;&lt;div class="if-quote-message-margin"&gt;Hi,&lt;br/&gt;&lt;br/&gt;is it possible to combine the AAT with keypress as response device instead of the joystick or mouse? And if so, how can I ensure that the keypress is linked to the zoom effect such that if the key is pressed, the picture increases/decreases and if the key press is stopped the movement of the Picture is&amp;nbsp;also stopped?&lt;br/&gt;&lt;br/&gt;Best&lt;br/&gt;Charlotte&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="26524"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;It's possible, but you'll have to make some extensive modifications to the script. When a given key is pressed, you'll want to start the zoom in or zoom out sequence, depending on which key was pressed. You'll have to decide on some fixed time and size change for each zoom step, and those &amp;lt;trial&amp;gt; elements ought to be set up to detect a key release and then stop the sequence accordingly. When you're working with a regular keyboard, keys are identified by their respective keyboard scan code (see Tools -&amp;gt; Keyboard Scancodes...). A key release is specified by prepending a minus sign to the respective scan code, i.e.&lt;br/&gt;&lt;br/&gt;&amp;lt;trial press&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ validresponse = (57)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;would detect a press on the space bar, while&lt;br/&gt;&lt;br/&gt;&amp;lt;trial release&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ validresponse = (-57)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;would detect the space bar's release.&lt;br/&gt;</description><pubDate>Tue, 05 Mar 2019 09:05:37 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>