How to detect if shift has been released?
<p>I want to be able to run a function when the shift key is released.</p>

<p>I know the shift key can be detected with something like:</p>

<pre><code>$(window).bind("keydown keyup", function(ev) { ... });
</code></pre>

<p>It works very well for detecting key combinations (e.g. <code>shift+a</code>). Problem is, if you want to detect the shift key itself, this triggers a <code>keydown</code> with <code>ev.shiftKey=false</code>, <code>ev.which=16</code> and a <code>keyup</code> with <code>ev.shiftKey=true</code>, <code>ev.which=16</code>. I've tried to attach an event to this combination on <code>keyup</code>, but this fail in a very subtle way when both shift keys are pressed: for the second shift key you get both <code>keyup/keydown</code> with <code>true,16</code> and then you get another <code>keyup</code> with <code>true,16</code> when the first shift key is released. </p>

<p>Is there any clean way to do this? Or should I just ignore the two shift key case?</p>
