How to click a button to return event


Author
Message
ben liu
ben liu
New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)
Group: Forum Members
Posts: 1, Visits: 6
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>
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search