Hey!
I'm writing a class where I'm at one point is trying to find out if
the shift key is pressed or not. On the key-down event it woks fine,
but on the key-up it returns false (when I release the shift key). Is
that correct? How can I find out if it in fact was the shift-key that
was released?
$(element).addEvent('keydown', function(event){
console.log('down', 'shift: ' + event.shift); // writes 'down,
shift: true'
if(event.shift) { this.shiftKeyIsDown = true; }
});
$(element).addEvent('keyup', function(event){
console.log('up', 'shift: ' + event.shift); // writes 'up, shift:
false'
if(event.shift) { this.shiftKeyIsDown = false; }
});
/Martin