Feb 15, 2010

A4Tech X710F 3XFire To 2XFire (X7 Triple click to double click)

I work(.Net) with an A4Tech X7 mouse (X710F). It is useful for programming because it has programmable side buttons. I use theese for copy and paste. (much more faster than Ctrl+C - Ctrl+V)
It has a nice 3Xfire button which is a fun but it is good-for nothing. It should useful if it would be a double click button. Because double click on a word == select word. Unfortunately it is not reprogrammable from built in driver software. I scanned google, forums and everywhere without any luck to find something to change this. Finally I found a very useful program:
http://www.autohotkey.com/
I read a lot from it's help and checked forums but I can't found solution to reduce number of click, so I tried to research my own algorythm :). After a lot of buggy version i found the solution which works always for me.
(the only little problem with it is in total commander left click on a file. It has to be changed to windows method in TC settings)
Here is the final version of AHK script (after a lot of hours spent to solve this little trick :) ):
LButton::
   if (First = 0)
   {
      Clicks := 0
      First := 1
   }
   If (A_ThisHotkey = A_PriorHotkey)
   {
      If (A_TimeSincePriorHotkey <= 157 && A_TimeSincePriorHotkey > 122)
      {
         If (Clicks = 0)
         {
             Clicks := 1
         }
         else
         {
             Clicks := 0
             Return
         }
      }
      else
      {
         Clicks := 0
      }
   }
   else
   {
      Clicks := 0      
   }
   Click Down
   KeyWait, LButton
   Click Up
Return

It is a small script but it was not as easy as it looks like. I tried with tilde, timers, in every combination, but this works :). I have a double click button :).
(maybe I am stupid because I am happy with this).
While finding this solution i added some other useful programming speed-up trick to AHK script. 
Just an idea: left Click + Left mouse move: Cut selected text. 
I hope You found this useful.


P.S. I found that there are some new a4Tech Product on market which seems to be better for programming than this one: A4-Tech K5-52D 16in1 I think it is programmable for double click function, and it has built in mouse "gestures" function.

12 comments:

Anonymous said...

thanx, man! Good job! Very, very useful thing!!!

Imi said...

You're welcome! This was my first Blog article and I am glad to see if somebody can use it.

Anonymous said...

Perfect. Thank you.

Imi said...

You're welcome!

Unknown said...

Man this is great! I google it for this problem and i found your post with the solution. I can't thank you enough! After months of useful triple click, i finally have double click!!! :)

Imi said...

You're welcome. Double click button is quite useful. I still use it and this is why I buy a4tech mouse if need a new one. I haven't found any mouse from other manufacturers which has a button next to the center button.

Anonymous said...

where do i put this script?

Imi said...

After you installed autohotkey - it will create a script file in your documents folder with ahk extension. You should edit that file and put this script that file. After that if you start autohotkey it will start this script automatically. I recomment to create an autohotkey shortcut into startup folder so it starts with windows automatically.

Anonymous said...

Thanks man! Finally "3xfire" button became useful.

You, sir, have done an excellent work here!

Anonymous said...

Is there a way to change it from double click to the letter L (for game binds)

Anonymous said...

the guy is probably dead by now lol

Imi said...

No, I still alive :). I checked this blog years before. I almost forgot it. Unfortunately it is not too simple to change the script to type a letter instead of triple click because this code blocks the third click but leaves the first and second click. If you would like to type letter, you have to block every click and if there is a third you have to use send command. But if there is no third click you have to send out the first one or two clicks. It is not that easy. But propably you don't need the solution after four years :).
Anyway, I don't use A4Tech mouse any more. They are not bad and I still need the double click button next to the wheel. So I made a custom mouse based on a Cooler Master MasterMouse S. I added 7 extra buttons to the mouse with an external arduino (including the double click button) :). It is wired but my next plan is to create a wireless version based on Logitech G305.