Goofiness On Keypress

1 view
Skip to first unread message

J Malinsky

unread,
Apr 6, 2009, 4:40:00 PM4/6/09
to javascript-im...@googlegroups.com
Hi everyone

I was getting major goofiness when trying to use the arrow keys to move the cropper in my application. (in fact, pressing the open bracket (shift-9) moved my cropper downwards). Since it only affected my app, and not the demo, it might not be pertinent to everyone.

But... this is the fix. IE 7/8 (and 6?) does not recognize "onkeypress" for arrow keys... it does recognize keyup though.

So, changing the following in the onLoad source:

if( this.options.captureKeys ) {
this.keysBind = this.handleKeys.bindAsEventListener( this );
Event.observe( document, 'keypress', this.keysBind );
}

to

if( this.options.captureKeys ) {
this.keysBind = this.handleKeys.bindAsEventListener( this );
Event.observe( document, 'keyup', this.keysBind );
}


.... made everything peachy keen. hope it helps someone.

thanks

Reply all
Reply to author
Forward
0 new messages