Question: I am trying to listen to the shift key being pressed and released again using jQuery.

See JSFiddle [here](http://jsfiddle.net/669QT/)

```
$(document).bind('keydown', function (event) {
    if (event.shiftKey) {
        document.body.innerHTML += 'shift down<br>';
    }
});
$(document).bind('keyup', function (event) {
    if (event.shiftKey) {
        document.body.innerHTML += 'shift up<br>';
    }
});

```

The keyup/keydown events seem to be called properly in general. However, if shift is the only button being pressed then `event.shiftKey` is only set for the keyDOWN event, not for the keyUP event. You can see that in the JSFiddle the "key up" message is never printed in this case. However, if I press shift + something else (e.g. Ctrl) everything works like it should.

Is this a bug in jQuery? Any workarounds?

Answer: 
Try [this](http://jsfiddle.net/669QT/2/)

```
$(document).bind('keydown', function (event) {
    if (event.keyCode == 16) {
        document.body.innerHTML += 'shift down<br>';
    }
});
$(document).bind('keyup', function (event) {
    if (event.keyCode == 16) {
        document.body.innerHTML += 'shift up<br>';
    }
});

```

checking the keycode works .. but event.shiftkey does not seems to work in keyup
e.shiftKey has a bug, I tried it. Does not work (My guess maybe on older instances) 
Whereas e.which === 16 works perfectly fine.

```
          self.on("keyup", ""+id, function(e) {
                if (e.which === 16) {
                    console.log(e.which);
                    // Your Code :)
                }
          }

```