Skip to content

fix: add missing delay between clicks in MouseDClick()#167

Open
Dabao21 wants to merge 1 commit intolsdefine:mainfrom
Dabao21:fix/mousedclick-delay
Open

fix: add missing delay between clicks in MouseDClick()#167
Dabao21 wants to merge 1 commit intolsdefine:mainfrom
Dabao21:fix/mousedclick-delay

Conversation

@Dabao21
Copy link
Copy Markdown

@Dabao21 Dabao21 commented Apr 25, 2026

Problem

In memory/ljqCtrl.py, MouseDClick() fires two rapid click events without any delay between MouseDown() and MouseUp():

def MouseDClick(staytime=0.05):
    MouseDown(); MouseUp() 
    MouseDown(); MouseUp() 
    time.sleep(0.05)

Compare with MouseClick() which has time.sleep(staytime) between down/up. Without this delay, the OS may interpret the two rapid clicks as a single long press rather than a double-click, making MouseDClick() unreliable.

Fix

Add time.sleep(staytime) between each MouseDown()/MouseUp() pair, and time.sleep(0.05) between the two clicks, matching MouseClick() behavior:

def MouseDClick(staytime=0.05):
    MouseDown(); time.sleep(staytime); MouseUp(); time.sleep(0.05)
    MouseDown(); time.sleep(staytime); MouseUp(); time.sleep(0.05)

Impact

  • Double-click operations now work reliably on Windows
  • Behavior is consistent with MouseClick() implementation

MouseDClick was firing two click events without any delay between MouseDown and MouseUp, which can cause the OS to interpret them as a single long press instead of a double-click. Now matches MouseClick behavior with staytime delay between down/up and 0.05s gap between the two clicks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant