Page 1 of 1

Replacing a key (Click & Drag)

Posted: 29 May 2018, 15:39
by RekTek249
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 ?

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

Posted: 29 May 2018, 15:48
by MaxAstro
Maybe try this?

Code: Select all

*XButton1:: Send {LButton down}
*XButton1 up:: Send {LButton up}

Re: Replacing a key (Click & Drag)

Posted: 29 May 2018, 15:58
by RekTek249
That worked, thanks a lot :)