diff --git a/source/Ox.UI/js/Core/Keyboard.js b/source/Ox.UI/js/Core/Keyboard.js index 9bbd4d33..ca51c8c8 100644 --- a/source/Ox.UI/js/Core/Keyboard.js +++ b/source/Ox.UI/js/Core/Keyboard.js @@ -63,12 +63,12 @@ Ox.Keyboard = (function() { // clear the trigger timeout only if the key went into the buffer clearTimeout(triggerTimeout); triggerTimeout = setTimeout(function() { - focused !== null && Ox.UI.elements[focused].triggerEvent('keys', { - keys: buffer - }); - }, 25); - // fixme: used to be 250, but seemed too much. - // if it stays at 25, we may not need a timeout at all + if (focused !== null) { + Ox.UI.elements[focused].triggerEvent('keys', { + keys: buffer + }); + } + }, 250); } } // clear the reset timeout even if the key didn't go into the buffer @@ -77,7 +77,7 @@ Ox.Keyboard = (function() { buffer = ''; }, 1000); - //Firefox will cancel active XMLHttpRequests otherwise + // Firefox cancels active XMLHttpRequests when pressing escape if (keyName == 'escape') { event.preventDefault(); }