Hi everyone,
I am here posting to discuss how I modified my experiment to respond to a single tap from a touch screen. Originally I had an issue where the experiment I was working on required a user to double tap a screen or to tap and hold the screen for the experiment to register the response. This was not ideal and the result was a forced effort to get the system to register a response.
What I learned was that I could solve this using the code module in the builder. With the advice from Rebecca Hirst I was able to implement a hover method that resulted in the desired functionality. At the beginning of the routine a set of if statements are checked to see if the “mouse” (user’s cursor of where they will tap) is within one of the given images/shapes. If so the response is measured and the experiment continues.
Within the code module I added the following functionality.
At Begin Routine
I reset the cursor’s position with the setPos() function.
At Each Frame
I setup the if statements responsible for handling a press or “hover”.
if CorrectTarget.contains(Mouse/Curosr):
Set Correct response text
Set Correct response message
Set Correct response audio
ContinueRoutine = False
if IncorrectTarget.contains(Mouse/Curosr):
Set Incorrect response text
Set Incorrect response message
Set Incorrect response audio
ContinueRoutine = False
With the following implementation I was able to achieve the functionality for my experiment. Users can make an effortless single tap and the experiment will record the response appropriately.