AHK_X11 icon indicating copy to clipboard operation
AHK_X11 copied to clipboard

Right Click Mouse Button (RButton) Not Releasing Modifier Keys After AHK_1.0.1 Update

Open BrandowLucas opened this issue 11 months ago • 2 comments

After updating to AHK_1.0.1, binding the Left Alt key (LALT) to the right-click mouse button (RButton) no longer releases the right mouse button upon LALT key release. Instead, it continues to hold the right mouse button. This behavior is likely after the commits 3b9a7e6 and 1e095e7.

Script Used:

lalt::RButton

Expected Behavior: The expected behavior is that when the Left Alt key (LALT) is pressed, it should emulate the right mouse button (RButton). Once the LALT key is released, the RButton should also be released immediately.

Actual Behavior: After the update, when the Left Alt key (LALT) is pressed, the right mouse button (RButton) is simulated and held down. However, when the LALT key is released, the RButton remains held down and does not release automatically.

Steps to Reproduce:

  1. Bind the LALT key to RButton using the script: lalt::RButton

  2. Press and hold the Left Alt key (LALT).

  3. Observe that the right mouse button (RButton) is held down as expected.

  4. Release the Left Alt key (LALT).

  5. Notice that the right mouse button (RButton) remains held and is not released.

Impact: This issue creates unintended behavior, where the right mouse button (RButton) stays pressed after releasing the LALT key. This affects other actions that rely on the RButton being released.

Suggested Fix: Is there a way to ensure that the right mouse button (RButton) is released instantly when the Left Alt key (LALT) is released, similar to the previous behavior before the commits 3b9a7e6 and 1e095e7?

Operating System: EndeavourOS KDE 6.2 (x11 session).

BrandowLucas avatar Jan 20 '25 20:01 BrandowLucas

haven't looked into this. I guess for now the workaround would be to add a send {RButton up} manually

phil294 avatar Feb 19 '25 21:02 phil294

I’ve tried the following script:

$LAlt::
Send {RButton down}
return

$LAlt up::
Send {RButton up}
return

However, the issue persists. When I tried this alternative approach:

$LAlt::
Send {RButton down}
KeyWait, LAlt  ; Wait for LAlt to be released (do not work)
Send {RButton up}
return

It does release the LAlt key, but it also releases the right mouse button (RButton) even when LAlt is still being held down. Ideally, the RButton should only release once LAlt is released.

BrandowLucas avatar Mar 08 '25 22:03 BrandowLucas