Millisecond Forums

Trigger end of trial with Enter key

https://forums.millisecond.com/Topic21787.aspx

By gjcooper - 6/6/2017

Hi,

I have been tasked with created an experiment where the participant judges the age of a facial image.

The instructions are to use the numpad on the keyboard to enter the age, then press enter to move to the next trial.

I have so far implemented this by creating a surveypage with the image and a textbox, but I cannot see any way of detecting an enter keypress on the textbox and manually triggering the next button (or removing the next button from the screen). Is anything along these lines possible?

If this approach is not possible then perhaps something like a standard trial, that gathers multiple number responses and only triggers the end of the trial when the Enter key is pressed? Would that work?

Sorry - I am new to Inquisit and unsure as to what is possible.

Gavin
By Dave - 6/6/2017

gjcooper - Tuesday, June 6, 2017
Hi,

I have been tasked with created an experiment where the participant judges the age of a facial image.

The instructions are to use the numpad on the keyboard to enter the age, then press enter to move to the next trial.

I have so far implemented this by creating a surveypage with the image and a textbox, but I cannot see any way of detecting an enter keypress on the textbox and manually triggering the next button (or removing the next button from the screen). Is anything along these lines possible?

If this approach is not possible then perhaps something like a standard trial, that gathers multiple number responses and only triggers the end of the trial when the Enter key is pressed? Would that work?

Sorry - I am new to Inquisit and unsure as to what is possible.

Gavin

The proper <trial>-type element to use for this would be <openended> (not a <surveypage> with a <textbox>. If configured properly, <openended> will advance upon pressing the ENTER key (see the 'Remarks' section: https://www.millisecond.com/support/docs/v5/html/language/elements/openended.htm ). And you can use the /mask and/or range to restrict input to numerical.

Quick example:

<block myblock>
/ trials = [1-4=enter_age]
</block>

<openended enter_age>
/ stimulusframes = [1=facepic]
/ numlines = 1
/ inputdevice = keyboard
/ mask = positiveinteger
/ position = (50%, 80%)
</openended>

<picture facepic>
/ items = faceitems
/ size = (25%, 25%)
</picture>

<item faceitems>
/ 1 = "face_01.jpg"
/ 2 = "face_02.jpg"
/ 3 = "face_03.jpg"
/ 4 = "face_04.jpg"
</item>