I have a MenuBar setup with YUI's MenuBar widget, and I have a YAHOO.util.KeyListener attached to 'document' to get quick keyboard access to the menus and submenu items (e.g. 's' to open the Setup menu). The problem is that the keylistener will still fire when a user is in an input element. For example, a user might be typing 'soup' into a text field, and the 's' character will cause the Setup menu to pop open.
One solution would be to disable the keylistener when focus is on an input element, and enable it on blur. How would I go about doing this? Is there a better solution?