I recently developed a task where participants make responses by clicking onscreen buttons using a mouse, and am now adapting it to work with touchscreen clicks. For the mouse version, I recorded clicks in a code component using “mouse.isPressedIn”, but as other Psychopy users have found previously, this doesn’t work properly with touchscreen clicks (the onscreen button must be touched and swiped, rather than just touched).
To get around this, I used a solution recommended to someone else who previously had this issue (https://groups.google.com/forum/#!topic/psychopy-users/u5p2yAFGGpg), which uses “image.contains(mouse)” instead of “mouse.isPressedIn” **. Although this solution works inasmuch as a single touchscreen touch is now registered as a click, it creates a new problem in which the single touch is additionally registered as several extremely short-latency clicks (e.g., rt =.004), which causes the experiment to go through the subsequent trials extremely fast (they aren’t even visible). I also had this problem when using the mouse, which I solved by adding mouse.clickReset() in the Begin Routine tab of the code component, but this solution doesn’t work in the touchscreen version, since the trials are now advanced based on the mouse position within an onscreen button rather than an actual click.
I imagine there should be some solution similar to the mouse.clickReset() one - maybe set the position of the mouse to the center of the screen (where there are no buttons) at the beginning of the routine? But I haven’t figured out how to implement one, so feedback would be appreciated.
**I also tried an alternate touchscreen solution suggested by Lily here https://groups.google.com/forum/#!topic/psychopy-users/uJcJb73H630, but it didn’t work for me - it instead caused clicks to no longer do anything.