title: autohotkey: simulate mouse press and hold
body: <p>Using autohotkey, I am trying to do make:</p>
  
  <ul>
  <li>pressing and holding LCtrl &amp; LShift behave like pressing and holding RCtrl + Left mouse button</li>
  <li>releasing LCtrl &amp; LShift behave like releasing RCtrl + Left mouse button</li>
  </ul>
  
  <p>ideally the order in which the keys are pressed should not matter.</p>
  
  <p>What I have at the moment is:</p>
  
  <pre><code>LCtrl &amp; LShift::
     If (A_PriorHotKey = A_ThisHotKey) ;these are built in variables
     return
     Send {RCtrl Down}
     MouseClick, left,,, 1, 0, D  ; Hold down the left mouse button.
  return
  
  LCtrl &amp; LShift Up::
    Send {RCtrl Up}
    MouseClick, left,,, 1, 0, U  ; Release the mouse button.
  return
  </code></pre>
  
  <p>While pressing ^LShift does simulate pressing RCtrl &amp; Left click, releasing ^LShift does nothing <em>most</em> of the time. Usually, even if I release them, RCtrl + Left click keep being "pressed" and I have to manually press them to (activate and) deactivate them.</p>