AMA3 wrote:
> ...
> Any chance that a browser-independent solution can be added to 1.5.2 so we
> don't have to write a cross-browser method ourselves?
>
> ...
That is a really good point. I've created these methods for an app.
What do you think? We could submit a patch...
It is quite simple to write event.which || event.keyCode but I suppose
something like Event.keyCode(event) is more straightforward.
Event.keyCode = function(event) {
return event.which || event.keyCode;
};
Event.ascii = function(event) {
var decimal = Event.keyCode(event);
return decimal>=32 ? String.fromCharCode(decimal) : '';
};
-- Ken Snyder
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---