OS : Windows 11 PsychoPy version : 2023.2.3 Standard Standalone? : y
Hi, I am using PsychoPy builder to run the experiment. I have a touchscreen laptop which I’d like to use for the experiments. In the documentation, it says:
Mouse responses register as touch responses on touch screen devices, so they do make for a more portable online study.
How do I make the PsychoPy builder detect my touchscreen? Does this work in the standalone program or do I have to pay for the subscription and run it on Pavlovia Cloud to get the touchscreen working?
As far as I know you do not need to do anything extra to detect your touchscreen. It should work with both offline on Standalone and online on Pavlovia. Just code your experiment using mouse components and any touches to the screen will be registered as mouse clicks.
To use a touchscreen locally you might need to use contains/hover code rather than clicks. My experience is that locally you have to stroke the screen to register a click.
Got the solution. To whoever has issues: The touchscreen only works with the Javascript (local or pavlovia in browser) backend. DO NOT USE THE PYTHON BACKEND IF YOU WANT PROPER TOUCH CONTROLS.
By proper I mean, no double tap or stroking. The browser version just works.
Hi, I am running an experiment offline on a touchscreen where participants listen to words or stories and have to select the corresponding picture within a set of four pictures. The experiment works except that you indeed need to stroke the screen and I would like simple taps. You mention using “contains/hover code rather than clicks”, how do you do that?
Can you try creating a new application and testing it in the browser (PsychoJS)? I had the same issue and had to recreate the who experiment for it work. Not sure why
It is pretty straight forward. Just replace “mouse” by the actual name of your mouse component (e.g., “mousetrial”) and in rec.contains, replace “rec” by the name of your component (e.g., if people have to tap on a picture, then replace “rec” by the name of your picture component (e.g., picture1.contains)).
Wakecarter, using your code, when looking at the data sheet, does it mean that the RT is rec.stopped - rec.started ? (In the case of an experiment where touching the component makes the experiment move to the next frame/component) In other words, does PsychoPy record the moment you touch the touchscreen as the end of the frame or does it record when the component disappears from the screen (which could be a few ms after touching the screen)?
I usually use t (the routine time) and I have found that it is better to put rt = t in the Each Frame code where continueRoutine = False is called rather than just use the value in End Routine (though I do often do this as well since I’m not usually worried about the RT values being around 16ms too large unless I’m also comparing with keyboard reactive times).
Thank you. So if I dont need to compare with keyboard or mouse reactive times I can use rec.stopped - rec.started? And I would be able to compare the RT between frames and between participants? Like it would be around 16ms too large for everyone?
Thank you! And also using this code, I have built a few trials in loops where participants have to select a picture among 4 pictures by touching the screen. The first trial of the experiment is a practice. However, for the first picture to select within that loop, the experiment often crash after the participant select an image with this error: “UnboundLocalError: localvariable ‘answer_ListeningPractice’ referenced before assignement”. When it does not crash and goes through this first selection, there are no more issues (even though it is the same loop so the same coding). It seems like it happens when the participant touches a little bit strongly the screen (however if they touch the screen strongly for the following pictures, nothing happen). Any insights?
Yes it is, it is recording the answer of the participant (i.e., which picture they have chosen). But the thing is that it is a loop and when participants touch softly the screen on this first picture then for the following pictures the experiment does not crash and the answers are well recorded by PsychoPy.