Mislav,

Looking forward, would observing the keydown event *as well* as the keypress
event when the keypress event is observed and copying the keycode property
to the keypress event object be an option?

Gareth Evans


On Nov 9, 2007 4:19 AM, Mislav Marohnić <[EMAIL PROTECTED]> wrote:

> Hi Russel,
>
> In Prototype 1.6 we no longer translate "keypress" to "keydown":
> http://dev.rubyonrails.org/changeset/7928
>
> We did that before because the codes are not properly set cross-browser
> with that event. This is exactly what you're having issues with now, in my
> opinion. I suggest you use "keyup" or "keydown" explicitly, you'll find that
> keyCode will probably be readable with those events.
>
> We count on our users to know enough about the differences between
> keyup/down/press to be able to choose between the three accordingly, and
> that they are aware of some cross-browser oddities. But in my opinion,
> regular users will need "keyup" most of the time.
>
> - M
>
>
>
> On Nov 8, 2007 4:08 PM, RussellZ <[EMAIL PROTECTED]> wrote:
>
> >
> > I'm using Prototype 1.6.
> > I added the following code to my page:
> >
> > Event.observe(document, "keypress",
> >    function(event) {
> >        alert(event.keyCode);
> >    });
> >
> > I get an alert for most keys. However, for the arrow keys and
> > backspace I do not get an alert (IE 6/7). It does work in Firefox.
> >
> >
> > > >
> >

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to