How do I have YAHOO.util.KeyListener disabled when an input element is focused?

I commend you for trying to provide keyboard shortcuts, but be aware that this will be a bit of a pain to implement cross-platform. If it's feasible, I strongly recommend using access keys on a tags If you're still going, I guess accesskey won't work for you. I'll assume you've read the relevant YUI tutorial If blur and focus are really the right way to go, I'd use something like YAHOO.util.Event.

OnDOMReady(init); function init() { // set up the keyboard listeners setUpExceptionsToKeyboardShortcuts(); } function disableShortcuts() { // Do what you've got to do } function enableShortcuts() { // Do what you've got to do } function setUpExceptionsToKeyboardShortcuts() { var focusable = document. GetElementsByTagName('input'); focusable = focusable. Concat(document.

GetElementsByTagName('select')); focusable = focusable. Concat(document. GetElementsByTagName('textarea')); YAHOO.util.Event.

AddListener(focusable, 'focus', disableShortcuts); YAHOO.util.Event. AddListener(focusable, 'blur', ensableShortcuts); }.

I commend you for trying to provide keyboard shortcuts, but be aware that this will be a bit of a pain to implement cross-platform. If it's feasible, I strongly recommend using access keys on tags. If you're still going, I guess accesskey won't work for you.

I'll assume you've read the relevant YUI tutorial. If blur and focus are really the right way to go, I'd use something like YAHOO.util.Event. OnDOMReady(init); function init() { // set up the keyboard listeners setUpExceptionsToKeyboardShortcuts(); } function disableShortcuts() { // Do what you've got to do } function enableShortcuts() { // Do what you've got to do } function setUpExceptionsToKeyboardShortcuts() { var focusable = document.

GetElementsByTagName('input'); focusable = focusable. Concat(document. GetElementsByTagName('select')); focusable = focusable.

Concat(document. GetElementsByTagName('textarea')); YAHOO.util.Event. AddListener(focusable, 'focus', disableShortcuts); YAHOO.util.Event.

AddListener(focusable, 'blur', ensableShortcuts); }.

The reference to access keys was great, I completely forgot about them. Unfortunately, they won't be good enough for this situation. – user13200 Oct 1 '08 at 17:40.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions