I hope that when the continue button, start, and end buttons are pressed, the event can be returned through the following port, but it seems that the event is sent out when the screen show.
How to send event when pressing button ?
Thank you so muck.
--------------------------------------------------------------------------------------------------------------------
<trial instructions>
/ ontrialbegin = [
if (trial.instructions.trialcount > 0){
button.continuebutton.skip = true;
button.start.skip = false;
} else {
button.continuebutton.skip = false;
button.start.skip = true;
};
]
/ stimulustimes = [1=clearscreen, instructions , continuebutton , start , end, myPort]
/ inputdevice = mouse
/ validresponse = (continuebutton, start, end)
/ ontrialend = [
if (trial.instructions.response == "continuebutton") {
port.myPort.setitem(1);
} else if (trial.instructions.response == "start") {
port.myPort.setitem(2);
} else if (trial.instructions.response == "end") {
port.myPort.setitem(3);
}
]
/ recorddata = false
</trial>
<port myPort>
/ port = COM3
/ subport = data
/ items = ("00000100","00000101","00000110") //4,5,6
</port>