Hi,
Does anyone have any thoughts on this patch?, is there any chance of
getting it put in trunk?
I'm using this patch primarily so that I can detect <ENTER> keypresses
on an <input type="text"> that's in a form. With this patch, I can now
do it with onkeypress (rather than down or up) and stop the event
successfully in all browsers (Opera, IE, and FF).
Perhaps if this patch is accepted, some rewording of the documentation
to indicate this is now possible would be a good idea too.
On 11/9/06, Martyn Smith <[EMAIL PROTECTED]> wrote:
>
> For certain special keys in firefox the MochiKit event returns code ==
> 0. This patch means that in that case, it will instead return the
> event's keyCode (which for many keys gives a useful value).
>
> This makes firefox keypress event behaviour closer to that of IE,
> Safari, and Opera.
>
> Index: MochiKit/Signal.js
> ===================================================================
> --- MochiKit/Signal.js (revision 1191)
> +++ MochiKit/Signal.js (working copy)
> @@ -266,6 +266,10 @@
> typeof(this._event.charCode) == 'undefined') { //
> IE
> k.code = this._event.keyCode;
> k.string = String.fromCharCode(k.code);
> + } else if (this._event.keyCode &&
> + this._event.charCode == 0) { // FF
> + k.code = this._event.keyCode;
> + k.string = '';
> }
>
> this._key = k;
>
>
> >
>
--
Martyn
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---