Returns true if the visual stimulus contains the given point on the screen.
boolean
Name | Type | Description |
---|---|---|
x | extent | The horizontal screen coordinate. |
y | extent | The vertical screen coordinate. |
This trial checks at the end whether the mouse response coordinates for a 'left down mouse click' happened to be on the 'leftBox', the 'rightBox' or 'somewhere else'.
<trial move>
/ inputDevice = mouse
/ stimulusFrames = [1 = leftBox, rightBox]
/ validResponse = (mouseMove, lButtonDown)
/ onTrialEnd = {
values.resp = this.response;
if (this.response == mouse.lButtonUp){
if (shape.leftBox.containsPoint(mouse.x, mouse.y)){
values.resp = "left";
} else if (shape.rightBox.containsPoint(mouse.x, mouse.y)){
values.resp = "right";
} else {
values.resp = "somewhere else";
}
}
}
/ branch = {
if (values.resp == "mouseMove"){
return this;
}
return null;
}
</trial>