If you're trying to differentiate between "keypress" and "keydown",  
you may need to be aware of these lines in Event.observe:

if (name == 'keypress' &&
       (Prototype.Browser.WebKit || element.attachEvent))
       name = 'keydown';


TAG

On Jul 16, 2007, at 9:46 AM, Mirko wrote:

>
> Hi Ken,
>
> thank you for your reply. For what I know, what you say is not
> completely exact. The keypress event differs from the keydown for the
> fact that, for IE, the property keyCode of the event contains the char
> code associated to the key pressed, instead of the key code. Firefox
> returns 0 in keyCode property and the char code in the charCode
> property. So, if the keydown event is fired, the value of the keyCode
> property is not what I expected.
>
> For what concerns the onblur event, unfortunately one of our
> constraint is that the test must be performed on the key pressed, not
> on focus lost (sorry, I forgot to write it in the post).
>
> Thank you again
>
> Kind regards
>
> Mirko
>
>
> >


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

Reply via email to