phil294 / AHK_X11

AutoHotkey for Linux (X11-based systems)
GNU General Public License v2.0
815 stars 15 forks source link

both hotkey and function use mouse button, not working #49

Closed wangsitan closed 1 year ago

wangsitan commented 1 year ago

These works fine:

a::MouseClick, RIGHT

MButton::Send, xxx

But this doesn't work for me:

MButton::MouseClick, RIGHT

When I load this script, clicking mouse middle button did nothing (no middle button function, nor right button function).

I didn't define the hotkey MButton twice at the same time. Only one ahk script is loaded at one time.

phil294 commented 1 year ago

it looks like you are right. However, this seems to be a limitation of X11, perhaps of Linux in general. I had actually faced this too several years ago, at that time with xbindkeys+xte (same with xdotool): https://askubuntu.com/questions/585571/xte-mousedown-up-via-xbindkeys-not-working

The only solution in your case is to replace MButton:: with MButton up::. Hope that's still satisfying to you. I will also put this in the Readme.

thanks for the report!