I need the next script to react to a tap on a touchscreen. Important is to react not on the release but on the touch of the touchscreen. As the smartphones or tablets open apps on a touch of a tap rather than on a release. Initially, I thought that the mouse's button down/up is equivalent to the touch/release of the touchscreen. However, that is not the case.
Here is a script that prints "Position#" of the touch on a rectangle. Using the mouse, the script will print the "Position" after the left mouse button is pressed. Using the touchscreen, the "Position#" will be printed only after the release of the tap.
Do you know how can I control that the "Position#" is printed on a touch (on the touching itself, but not on the release) on the touchscreen?
figurePosition=[0 0 600 600];
StimPosition=[Xmin Ymin (Xmax-Xmin) (Ymax-Ymin)];
StimAxis=[0 10 0 10];
StimColor=[0 0.5 0.5];
continue_loop = true;
if x>=Xmin && x<=Xmax && y>=Ymin && y<=Ymax