I tried your solution. I can't get the mouseleave (not mouseLeave, according to the docs) to work. The warning message stays when I move my cursor away from the startButton, and the leaveStartButton event does not appear in the console.
{
conditions: [{type:'inputEquals',value:'startButton'}],
actions: [
{type:'removeInput',handle:['startButton']},
{type:'hideStim',handle:'startHandle'},
{type:'startMouseTracking', logAs:'tracking', logRate: 15, logStimulusLocation: ['startHandle']},
{type:'showStim',handle:'myDomHandle'},
{type:'showStim',handle:'myNonDomHandle'},
{type:'setInput',input: {handle:'dom',on:'click',stimHandle: 'myDomHandle'}},
{type:'setInput',input: {handle:'nonDom',on:'click',stimHandle: 'myNonDomHandle'}},
{type:'setInput',input:{handle:'moveWarning',on:'timeout',duration:400}}, // trigger warning if the participant doesn't move after 400 ms
{type:'setInput',input:{handle:'leaveStartButton',on:'mouseleave', stimHandle:'startButton'}}, // catch if the participant moves away from the button stimulus
{type:'resetTimer'}
]
},
{
conditions: [{type:'inputEqualsTrial', property:'correctResp'}], //Correct
actions: [
{type:'removeInput',handle:['All']},
{type:'stopMouseTracking'},
{type:'log'},
{type:'trigger',handle:'endTrial', duration:350}
]
},
{
conditions: [{type:'inputEqualsTrial', property:'mistakeResp'}], //Incorrect
actions: [
{type:'removeInput',handle:['All']},
{type:'stopMouseTracking'},
{type:'setTrialAttr',setter:{score:1}},
{type:'log'},
{type:'trigger',handle:'endTrial', duration:500}
]
},
{
conditions: [{type:'inputEquals', value:'moveWarning'}], //no movement
actions: [
{type:'showStim',handle:'moveWarningHandle'}, // show warning
{type:'setTrialAttr',setter:{score:2}},
{type:'log'}
]
},
{
conditions: [{type:'inputEquals', value:'leaveStartButton'}], // movement happened
actions: [
{type:'removeInput',handle : 'moveWarning'},
{type:'hideStim',handle : 'moveWarningHandle'}
]
},