On Thu, Apr 14, 2011 at 11:25 AM, Diego Perini <[email protected]>wrote:

> On Thu, Apr 14, 2011 at 10:37 AM, Amit Agarwal <[email protected]> wrote:
> > 'keypress' event works well in Chrome except for arrow keys.
> >
> > Any solution?
>
>  Use keydown/keyup to catch control (unprintable) keystrokes as suggested
> by Tim.
>

There's a catch. The keydown doesn't fire repetitively when you're holding
arrow keys. In a way that makes sense because you're not explicitly pushing
the key down (same for up). And since keypress doesn't fire (the character
rule is so silly..) you have no choice but to simulate this yourself.

In my case I needed to know where the caret was at any time. In the end I
had to fire a long polling timer to check the caret position every so often
because the events were useless to that case.

On a side note; we really need caret events :/

- peter

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to