Thanks for the response, here you go:

To the point:  I'm looking for a method to check if any form element
on the page has focus.

I've created an interface that works like a desktop application.  In
my data grids are a bunch of <li>'s that allow for keyboard navigation
via the 'keydown' event.  If you hit down then it "clicks" the next
<li>, or up it clicks the previous.

The problem comes up when you've got an input or textarea element
focused.  When you arrow left, right, up, down in the textarea (or
input) the keyboard navigation events fire on the <li> elements--I
don't want them to fire when I'm typing in a form.

I need a way to check if any form element has focus before firing the
'keydown' event.  I could check them all individually but that's not a
good solution since this is all inside a class.

On Mar 27, 6:09 am, Fábio Costa <fabiomco...@gmail.com> wrote:
> ?!
> I didn't understand, could you explain it better?
>
> Fábio Miranda Costa
> Engenheiro de Computaçãohttp://meiocodigo.com
>
>
>
> On Fri, Mar 27, 2009 at 2:14 AM, rpflo <rpflore...@gmail.com> wrote:
>
> > ...
> > } else if(event.key == 'e' && event.shift && quickCheckIfStuffHasFocus)
> > {
> >        this.buttons[2].fireEvent('click');
> > }
> > ...
>
> > I'd like quickCheckIfStuffHasFocus to be true before I go ahead and
> > fire the event.  When I'm typing in an input I really don't want the
> > keyboard stuff to work.
>
> > At the moment I'm storing true or false in a global variable and
> > checking against that, but that's ugly.
>
> > Any ideas?  Thanks!

Reply via email to