Replacing a key (Click & Drag) Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
RekTek249
Posts: 2
Joined: 29 May 2018, 15:32

Replacing a key (Click & Drag)

29 May 2018, 15:39

Hi, so my mouse LButton recently broke, so until I get a new mouse, I had the idea to map it to another button (MB4/5). I can use the touchpad for emergencies, but it really annoys me. I have the following code, which works:

Code: Select all

*XButton1:: Send {LButton}
However, this doesn't work in some programs, and the drag doesn't work either. Is there any way I could make it drag ? I also tried :

Code: Select all

$XButton1::
{
   toggle:=!toggle
   if (toggle)
    {
	  sendinput, {LButton down}
    }
   else
    {
	  sendinput, {LButton up}
    }
 }
return
But the thing is, this codes makes it that when I click, it starts a drag, so I can't single click with it. Any way I could fix that and correctly make a script to replace my main button ?
MaxAstro
Posts: 557
Joined: 05 Oct 2016, 13:00

Re: Replacing a key (Click & Drag)  Topic is solved

29 May 2018, 15:48

Maybe try this?

Code: Select all

*XButton1:: Send {LButton down}
*XButton1 up:: Send {LButton up}
RekTek249
Posts: 2
Joined: 29 May 2018, 15:32

Re: Replacing a key (Click & Drag)

29 May 2018, 15:58

That worked, thanks a lot :)

Return to “Ask For Help”

Who is online

Users browsing this forum: ark, Bing [Bot], LC99, mikeyww and 37 guests