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;
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---