Mouse no rt

12 views
Skip to first unread message

Arnaud Boré

unread,
Jul 7, 2016, 11:31:08 AM7/7/16
to expyriment-users
Dear expyriment experts,

Thank you again for your quick answers.

I've got an issue using the mouse. I use wait_press and sometimes I don't receive any rt. I tried to check what is the event_id but it doesn't give me any extra information and I tried to clear the buffer but it doesn't help either.
Is there something that I don't understand ?

Thank you in advance for your help

Arnaud

Arnaud Boré

unread,
Jul 7, 2016, 11:36:38 AM7/7/16
to expyriment-users
Just to be clear sometimes I don't receive any rt even if I click with the mouse. I think I should not get any rt only when I don't click.

Thank you

Arnaud

Oliver Lindemann

unread,
Jul 7, 2016, 1:49:35 PM7/7/16
to expyrime...@googlegroups.com
I do not understand what you mean with "you don't receive a rt"? Which value has rt? Could you send the code? Which operating system do you use?

Oliver
--
You received this message because you are subscribed to the Google Groups "expyriment-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to expyriment-use...@googlegroups.com.
To post to this group, send email to expyrime...@googlegroups.com.
Visit this group at https://groups.google.com/group/expyriment-users.
For more options, visit https://groups.google.com/d/optout.

-- 
Dr. Oliver Lindemann
Division of Cognitive Science - University of Potsdam
http://www.cognitive-psychology.eu/lindemann

Arnaud Boré

unread,
Jul 7, 2016, 2:21:47 PM7/7/16
to expyriment-users, oliver.l...@uni-potsdam.de
Thank Olivier for your quick response.

Running this script "creates" the bug:

import pygame
pygame.init()
pygame.display.set_mode((300, 300))
while 1:
if pygame.event.get(pygame.MOUSEBUTTONUP):
print 'up'

I checked into pygame code and it looks like this issue: https://bitbucket.org/pygame/pygame/issues/141/mousemotion-prevents-mousebuttonup-event
When you move and click at the same time, the event buffer is fill up to 127 elements capacity and no BUTTONUP event even if there are some BUTTONDOWN.

I think it's a pygame error, is there a way to bypass this ? 

Thank you

Arnaud

Oliver Lindemann

unread,
Jul 8, 2016, 4:15:29 AM7/8/16
to expyrime...@googlegroups.com
Your question is obviously related to Pygame programming not Expyriment! Please contact Pygame newsgroups in this cases. But you might find it helpful to see how Expyriment is doing it: https://github.com/expyriment/expyriment/blob/master/expyriment/io/_mouse.py#L248

You should disable buffering of mouse motions to avoid the your Pygame buffer is full within seconds: ```pygame.event.set_blocked(pygame.MOUSEMOTION)```

Fortunately, Expyriment cares about all this issues. Therefore I assume that this works, right? https://gist.github.com/lindemann09/f48cb912ca6b2cde0dbaa06f90b5fcef

Best,
Oliver
Reply all
Reply to author
Forward
0 new messages