Key Combination issue

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
meatheadmike
Posts: 2
Joined: 14 Oct 2017, 19:58

Key Combination issue

15 Oct 2017, 10:24

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
meatheadmike
Posts: 2
Joined: 14 Oct 2017, 19:58

Re: Key Combination issue

15 Oct 2017, 16:41

Thanks very much!

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

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Araphen, ArkuS, claudiosxj, Descolada, mikeyww, OrangeCat and 328 guests