JQuery or JavaScript: How determine if shift key being pressed while clicking anchor tag hyperlink?
<p>I have an anchor tag that calls a JavaScript function.</p>

<p>With or without JQuery how do I determine if the shift key is down while the link is clicked?</p>

<p>The following code does NOT work because keypress is only fired if a "real key" (not the shift key) is pressed.  (I was hoping it would fire if just the shift key alone was pressed.)</p>

<pre><code>var shifted = false;

$(function() {                           
    $(document).keypress(function(e) {
        shifted = e.shiftKey;
        alert('shiftkey='+e.shiftkey);
    });

    $(document).keyup(function(e) {
        shifted = false;
    });
}

...

function myfunction() {
  //shift is always false b/c keypress not fired above
}
</code></pre>
