psychopy.org | Reference | Downloads | Github

Double click Mouse Vs Trackpad

OS : W10 and Mac
PsychoPy version : 2020.1.3
Standard Standalone y

Apologies if this has been asked and answered before, I cannot find anything relevant on the forum.

The question is about a delay registering clicks using a touchpad which does not occur when using a mouse.

I have an exp whereby Ps are required to respond using either the mouse or the trackpad.
They can respond

  1. by pressing the left button of their mouse once or tap they trackpad once i.e. single click.
  2. by pressing the left button of their mouse twice or tap they trackpad twice i.e. double click.

Logic.
I have two routines, each containing a mouse component, a polygon and a code component. The first routine is for the single click and ends when a click occurs within the polygon and and the mouse is released. The second routine is for the double click and it lasts for 200ms.

While using a mouse, the double click works just fine, when using a trackpad either under Windows or under MacOS the double click does not work. It seems to me that it takes sometime to register the first tap before it moves to the second routine.

Could you please someone advise?

Below the code components.

First Routine
Begin Routine
mouse_was_down = False

Each Frame

if singleClick.isPressedIn(polygon):
    singleClickLeft = buttons[0]
    contninueRoutine = True 
    mouse_was_down = True

if mouse_was_down == True and not singleClick.isPressedIn(polygon):
    mouse_was_down = False
    continueRoutine = False

Second Routine
Begin Routine
mouse_was_down2 = False

Each Frame

if doubleClick.isPressedIn(polygon_3):
    doubleClickLeft = buttons[0]
    contninueRoutine = True 
    mouse_was_down2 = True

if mouse_was_down2 == True and not doubleClick.isPressedIn(polygon_3):
    mouse_was_down2 = False
    continueRoutine = False

So it looks like your logic is saying “if they click on the polygon, remember that they have, and the once they are no longer clicking on the polygon, move on”? I would put something in your double click routine like

if mouse_was_down2 == True and not doubleClick.isPressedIn(polygon_3):
    mouse_click_finished = True

if mouse_click_finished == True and doubleClick.isPressedIn(polygon_3):
    continueRoutine = False

Meaning that, once the first click is finished, it waits to end the routine until it gets another click