![]() ![]() |Pen and touch|Pen and touch support with 10 touch points| |System type|64-bit operating system, 圆4-based processor| The link takes you to a minimal example.īrowser: Microsoft Edge Version 1.44 (Official build) (64-bit) I have tried making the buttons with button components and also with a combination of textbox+mouse+code components. So even with this workaround I can’t get past the second screen. This only works once within an experiment. click about 1 cm ABOVE the middle of the button.There is one situation where I can proceed to the next screen: The buttons also look different: the text is no longer centred in the middle of the button (it is in the offline version). The buttons work fine when running the experiment offline, but cannot be clicked in the online version. Self._times = event.I’m making a series of experiment where people proceed from one trial to another by clicking buttons. Self._times = times # make copy in order to save old state (otherwise it is always identical with original times) If times != self._times: # self._times are times of last frame thus: was there a change in times? If yes, then there was a touch event If hasattr(self, '_times'): # available beginning with second pass # Update pressed status only once per window flipīuttons, times = (self, True) = types.MethodType(self._flip_and_update, ) # update pressed state after each flip to ensure that pressed state stays current throughout each flip cycle Self._updatePressed() # call once to initialize self._buttons Best practice: call win.flip() only once at the end of each trial processing loop -> Otherwise you might miss touch events without swipe motionĭef _init_(self, visible=True, newPos=None, win=None):Įvent.Mouse._init_(self, visible, newPos, win) # - ensure to check for mouse clicks after each win.flip(). # - short touch: left mouse button press, long touch: right mouse button press # Ensures that also touch events without swipe motion are registered as mouse clicks in PsychoPy (tested with Surface Pro Tablets) Just in case your are facing the same issue, here is the solution I developed to deal with this issue: # How to use: Is your experiment detecting all touches as mouse click events? In my case, only touches including a small swipe were detected as click events, but not a touch on the screen without finger motion. –> note that you need to pass the reference to your window to your function, in my case called “win” If I am correct, replacing the “wait” code with a while loop flipping the window until the audio file is finished should solve the problem. Thus, windows assumes that the window is unresponsive and offers the possibility to close your PsychoPy experiment. I’m wondering if there is a possible way to tell python to ignore touches while playing the recording? Or if there’s a better way to achieve the same goal?ĭue to using “wait”, Windows cannot dispatch the touch event to your PsychoPy window. It looks like this: # create a function to play audioĪudio = Sound(file,sampleRate=48000,stereo=True,secs=0.01)Īs a result, the program would (presumedly) ignore any touches while playing the recording.īut when the subject kept touching on the screen (some of the children did so despite the fact that the experimenter told him to stop), python would crash. ![]() The experiment ran smoothly on new Surface Pro and touches were registered as mouse clicks.īecause the subjects were mostly children (< 11-year-old), I created a function to prevent them from skipping the story. The participants were asked to press a button when they were ready to answer the questions or press another button if they wanted to listen again. In my experiment, the participants were asked to listen to a story and answer some questions afterwards. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |