def _onPygletMousePress(x, y, button, modifiers, emulated=False):
 global mouseButtons, mouseClick, mouseTimes
 now = psychopy.clock.getTime()
 if emulated:
  label = 'Emulated'
 else:
  label = ''
 if (button & LEFT):
  mouseButtons[0] = 1
  mouseTimes[0] = (now - mouseClick[0].getLastResetTime())
  label += ' Left'
 if (button & MIDDLE):
  mouseButtons[1] = 1
  mouseTimes[1] = (now - mouseClick[1].getLastResetTime())
  label += ' Middle'
 if (button & RIGHT):
  mouseButtons[2] = 1
  mouseTimes[2] = (now - mouseClick[2].getLastResetTime())
  label += ' Right'
 logging.data(('Mouse: %s button down, pos=(%i,%i)' % (label.strip(), x, y)))

def _onPygletMousePress ( x , y , button , modifiers , emulated = False ) : global mouseButtons , mouseClick , mouseTimes now = psychopy . clock . getTime ( ) if emulated : label = 'Emulated' else : label = '' if ( button & LEFT ) : mouseButtons [ 0 ] = 1 mouseTimes [ 0 ] = ( now - mouseClick [ 0 ] . getLastResetTime ( ) ) label += ' Left' if ( button & MIDDLE ) : mouseButtons [ 1 ] = 1 mouseTimes [ 1 ] = ( now - mouseClick [ 1 ] . getLastResetTime ( ) ) label += ' Middle' if ( button & RIGHT ) : mouseButtons [ 2 ] = 1 mouseTimes [ 2 ] = ( now - mouseClick [ 2 ] . getLastResetTime ( ) ) label += ' Right' logging . data ( ( 'Mouse: %s button down, pos=(%i,%i)' % ( label . strip ( ) , x , y ) ) )
button left=1 .