2

Hey my middle click button is kinda dead so I'm looking for a solution using Autohotkey.

What I want to do is send a middle click whenever I double right click, but I haven't been able to find a reliable solution so far.

Any suggestions?

1 Answer 1

3

Maybe not the most elegant way, but you could try this:
Modyfied from: http://www.autohotkey.com/board/topic/16321-map-a-double-left-mouse-click-to-a-single-key/

$RButton::
if clicks > 0
   clicks++
else
{
   clicks := 1
   SetTimer, ClickWait, 400
}
return

ClickWait:
SetTimer, ClickWait, off
if clicks = 1
{
   Click, Right
}
else
{
   Click, Middle
}
clicks := 0
return

When you don't mind having the Right-Click menu appear, you can use this code, which sends the Right-Click straight through and corrects it later.

~RButton::
if (A_PriorHotkey <> "~RButton" OR A_TimeSincePriorHotkey > 600)
    Return ; No double click, so stop!
Sleep, 100
Send, {Esc}
Sleep, 100
Click, Middle
return
4
  • The problem with this is that it will delay the response of the single right click. I don't mind sending a right click I think, as long as the second will be a middle click
    – Bar
    Mar 3, 2013 at 14:10
  • In that case you will always get the Right-Click menu on your screen, which you will have to undo with escape. Is that what you want? Mar 3, 2013 at 15:25
  • Yeah that won't be a problem, what do I need to change to do this?
    – Bar
    Mar 3, 2013 at 15:29
  • 1
    Just added the alternative code! Mar 3, 2013 at 16:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .