I’ve just added a new feature into the repository to make it easier for people to use visual stimuli (images, shapes, gratings, movies…) as virtual buttons. For a long time we’ve had the option to use code and insert snippets like
if sum(mouse.getPressed()) and myShape.contains(mouse): print("My shape was pressed")
Well what I’ve just added allows Builder to insert that sort of code for you. This is done from the Mouse Component rather than from the stimuli, but hopefully it will make sense this way. New dialog looks like below.
Mouse now has some extra options:
- clickable: allows you to say what objects should be treated as buttons
- store params for clicked: allows you to choose what info about the clicked object gets stored
- new clicks only: is like “discard previous” in the keyboard
- force end routine: used to be just True or False but this can now be “never” (like False), “any click” (like True) and “valid click” (new option so the routine doesn’t end unless the click the mouse on a “clickable” stimulus.
Use cases in my head:
- click on the image you like most: we set both images as clickable and store the
- visual search task: we only make the target clickable and measure reaction time until the participant clicks it
- corsi blocks task: now really easy to measure the sequence of clicks (don’t end the trial on any click) and see if it matches the original sequence
Any thoughts? Better names that novice users will find easier to understand?