title: Detect focus initiated by tab key?
body: <p>I want to detect the focus event of an element, but only if it was initiated by the user pressing the tab key. For example:</p>
  
  <pre><code>&lt;input type="text" id="foo" /&gt;
  &lt;input type="text" id="detect" /&gt;
  </code></pre>
  
  <p>If the user is focused on <code>#foo</code> and presses <kbd>Tab</kbd>, I want the event to fire once <code>#detect</code> becomes focused (or a conditional inside the focus event to be true). Conversely, if the user simply clicks on the <code>#detect</code> field to focus it, I do not want the event to fire (or I want the conditional inside the focus event call to be false). </p>
  
  <p>I don't want to use the keydown event of <code>#foo</code> and check if the tab key was pressed, as I want the approach to be independent of any other element.</p>
  
  <p>I looked through the console output of the following code, but couldn't notice any real differences between the two methods of focusing:</p>
  
  <pre><code>$('#detect').on('focus', function(e){
     console.log(e); 
  });
  </code></pre>
  
  <p>(<a href="http://jsfiddle.net/LPGLm/">fiddle</a>)</p>
  
  <p>Is this possible to accomplish in a relatively simple way? </p>