Using input boxes

User input via the keyboard can be received via the Input.getText(), Input.getNumber() and Input.getItem() commands of the scripting language QSA.

 

A text input box

 

A simple text input box can be created via the following function:

 

function Simple_text_input_box() {

 

var userResponse = Input.getText("Please enter the name of the experiment");

BrainVoyagerQX.PrintToLog("Name of the experiment: " + userResponse);

 

}

 

This will result in the following message box:

 

 

and print the text to the BrainVoyager QX Log tab:

 

 

A number input box

 

A simple number input box can be created via the following function:

 

function Simple_number_input_box() {

 

var userResponse = Input.getNumber("Please enter the number of subjects");

BrainVoyagerQX.PrintToLog("Number of subjects: " + userResponse);

 

}

 

This will result in the following message box:

 

 

An item input box

 

A simple item input box can be created via the following function:

 

function Simple_item_input_box() {

 

var userResponse = Input.getItem("Please select the stimulus", ["Houses","Faces"]);

BrainVoyagerQX.PrintToLog("Selected stimulus: " + userResponse);

 

}

 

This will result in the following message box: