I searched for hours and couldn't find a solution so figured maybe someone could help....
I want to use a key combination with two mouse buttons to execute copy, while preserving the default function of the mouse buttons when pressed alone.
So this is what I have
~XButton1 & LButton::
Send ^c
return
With that, when I press and hold down XButton1 and then Left click, it does copy (as expected)... but the problem is when I release the XButton1 on the mouse afterwards, it executes what the XButton1 does (going back in a web browser). If I remove the ~ from the beginning of the statement, it stops this from happening but it completely disables XButton1, so when I press it by itself it does nothing.
Basically I'd like XButton1's default function to be preserved when pressed by itself, but when used in a combination it should only execute the assigned function for the combination and not also do the default function of Xbutton1 when released.
Any help would be greatly appreciated. Thanks
Key Combination issue
-
- Posts: 2
- Joined: 14 Oct 2017, 19:58
-
- Posts: 2
- Joined: 14 Oct 2017, 19:58
Re: Key Combination issue
Thanks very much!GEV wrote:See https://autohotkey.com/docs/Hotkeys.htm#combo
I'll post what I did to get it to do what I wanted, just in case anyone else comes runs into the same issue. Basically as per that link, I just had to remove the ~ from the beginning, and then add code afterwards to allow XButton1 to work when pressed alone:
XButton1 & LButton::
Send ^c
return
XButton1::
Send {XButton1}
return