title: AutoHotkey detect keypress and send the pressed key without calling the function again
body: <p>Okay, so my problem is rather simple, I have tried searching but was unable to find anything.</p>
  
  <p>My code is like this:</p>
  
  <pre><code>T::
  Send t
  if(x=0)
  y=1
  Return
  </code></pre>
  
  <p>It creates a loop, which is pretty obvious to see.
  I have tried adding:</p>
  
  <pre><code>T::
  if(tx=0){
  Send t
  tx=1
  }else{
  tx=0
  }
  if(x=0)
  y=1
  Return
  </code></pre>
  
  <p>But that wont do it either, so my question is, is there a way to detect when the keypress was generated by the script or by the keyboard itself?</p>