title: How to remap a double click button in autohotkey
body: <p>I have a special mouse button that serves as a double click. It doesn't have any special key, it's just sending two LButton signals.</p>
  
  <p>I have introduced the #InstallMouseHook into my script to be able to track mouse clicks. I have gotten this after pressing the double button multiple times:</p>
  
  <pre><code>VK  SC  Type    Up/Dn   Elapsed Key     
  ---------------------------------------------------------------------------------------     
  04  000     d   2.78    MButton         
  04  000     u   0.19    MButton         
  01  000     d   0.65    LButton         &lt;- Manual DC     
  01  000     u   0.17    LButton         
  01  000     d   0.11    LButton         
  01  000     u   0.14    LButton         
  04  000     d   0.75    MButton         
  04  000     u   0.19    MButton         
  01  000     d   0.45    LButton         &lt;- Special button DC            
  01  000     u   0.00    LButton         
  01  000     d   0.00    LButton         
  01  000     u   0.00    LButton    
  </code></pre>
  
  <p>From what I assume The elapsed key is key to determining what is a double click (DC) by the DC mouse button and which one by me manually pressing left click two times. I want to remap the former scenario, not the latter (DC button::something else like middle click and my manual double left click to remain the same). So far it seems that the elapsed time for the DC button is &lt;2.0 and manual DC >2.0.</p>
  
  <p>The idea would be to have something like this (not in AHK language):</p>
  
  <pre><code>loop 
   if (LButton == 1) //pressed
      {
      t=StartElapseTimer;
      if (t&lt;2 &amp;&amp; LButton == 1) //how to check it went down and up before down the 2nd time?
         LButton::MButton; //the remapping I want
      else // t&gt;2
         Nothing //let me do a regular DC
      }
  end
  </code></pre>
  
  <p>Could you help me on how to start the timer and what environment variables need to be set? </p>
  
  <p>Thanks.</p>