button box translation


Author
Message
nrouhani
nrouhani
Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)
Group: Forum Members
Posts: 83, Visits: 261
hello, 

i am preparing an fMRI task where the buttons on the button box are associated with particular keys. is there a way to translate the button box input to another output key in inquisit? for example, one button is 'a', and i would like to print this response as 1 (instead of 'a') on the screen (participants must see their response on the screen during the task).

thank you!
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: 12K, Visits: 90K
nrouhani - 8/8/2022
hello, 

i am preparing an fMRI task where the buttons on the button box are associated with particular keys. is there a way to translate the button box input to another output key in inquisit? for example, one button is 'a', and i would like to print this response as 1 (instead of 'a') on the screen (participants must see their response on the screen during the task).

thank you!

You can always use <values> and /ontrialend logic.
nrouhani
nrouhani
Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)
Group: Forum Members
Posts: 83, Visits: 261
Dave - 8/8/2022
nrouhani - 8/8/2022
hello, 

i am preparing an fMRI task where the buttons on the button box are associated with particular keys. is there a way to translate the button box input to another output key in inquisit? for example, one button is 'a', and i would like to print this response as 1 (instead of 'a') on the screen (participants must see their response on the screen during the task).

thank you!

You can always use <values> and /ontrialend logic.

Particpants will see their answer being printed on the screen during the trial ("openended" trial). can i change the values before that, so the right value will be printed on screen?
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: 12K, Visits: 90K
nrouhani - 8/8/2022
Dave - 8/8/2022
nrouhani - 8/8/2022
hello, 

i am preparing an fMRI task where the buttons on the button box are associated with particular keys. is there a way to translate the button box input to another output key in inquisit? for example, one button is 'a', and i would like to print this response as 1 (instead of 'a') on the screen (participants must see their response on the screen during the task).

thank you!

You can always use <values> and /ontrialend logic.

Particpants will see their answer being printed on the screen during the trial ("openended" trial). can i change the values before that, so the right value will be printed on screen?

No. What you can do is something like this

<values>
/ keypressed = 0
</values>

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

<trial mytrial>
/ ontrialend = [
    if (trial.mytrial.response == 30) {
        values.keypressed = 1;
    } else if (trial.mytrial.response == 31) {
        values.keypressed = 2;
    } else if (trial.mytrial.response == 32) {
        values.keypressed = 3;
    } else if (trial.mytrial.response == 33) {
        values.keypressed = 4;
    }
]
/ stimulusframes = [1=mytext]
/ validresponse = ("a", "s", "d", "f")
/ branch = [
    trial.youpressed;
]
</trial>

<trial youpressed>
/ stimulusframes = [1=key]
/ trialduration = 1000
/ validresponse = (0)
</trial>

<text mytext>
/ items = ("Press one of the keys 'a', 's', 'd', or 'f'")
</text>

<text key>
/ items = ("You pressed key #<%values.keypressed%>")
</text>


but if the response box sends the code for an "A", then that's what the box sends. Inquisit cannot change that.


nrouhani
nrouhani
Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)
Group: Forum Members
Posts: 83, Visits: 261
Dave - 8/8/2022
nrouhani - 8/8/2022
Dave - 8/8/2022
nrouhani - 8/8/2022
hello, 

i am preparing an fMRI task where the buttons on the button box are associated with particular keys. is there a way to translate the button box input to another output key in inquisit? for example, one button is 'a', and i would like to print this response as 1 (instead of 'a') on the screen (participants must see their response on the screen during the task).

thank you!

You can always use <values> and /ontrialend logic.

Particpants will see their answer being printed on the screen during the trial ("openended" trial). can i change the values before that, so the right value will be printed on screen?

No. What you can do is something like this

<values>
/ keypressed = 0
</values>

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

<trial mytrial>
/ ontrialend = [
    if (trial.mytrial.response == 30) {
        values.keypressed = 1;
    } else if (trial.mytrial.response == 31) {
        values.keypressed = 2;
    } else if (trial.mytrial.response == 32) {
        values.keypressed = 3;
    } else if (trial.mytrial.response == 33) {
        values.keypressed = 4;
    }
]
/ stimulusframes = [1=mytext]
/ validresponse = ("a", "s", "d", "f")
/ branch = [
    trial.youpressed;
]
</trial>

<trial youpressed>
/ stimulusframes = [1=key]
/ trialduration = 1000
/ validresponse = (0)
</trial>

<text mytext>
/ items = ("Press one of the keys 'a', 's', 'd', or 'f'")
</text>

<text key>
/ items = ("You pressed key #<%values.keypressed%>")
</text>


but if the response box sends the code for an "A", then that's what the box sends. Inquisit cannot change that.


thank you, so I would not be able to translate the button presses to the correct values with an openended trial like below?

<openended estimate_art>
/ position = (50, 50)
/ buttonlabel = "please enter estimate"
/ fontstyle = ("Arial",20)
/ inputdevice = keyboard
/ validresponse = (noresponse)
/ stimulustimes = [0=sceneStim_current, estimateQ, leftHand, rightHand]
/ linelength = 3
/ range = (0,100)
/ numlines = 1
/ responsefontstyle = ("Arial",80)
/ posttrialpause = list.jitter_estimateList.nextvalue
/ trialduration = 3000 + list.jitter_estimateList.currentvalue
/ branch = [
trial.outcome_art
]
</openended>
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search