set interval between 'keys' events to 250 ms
This commit is contained in:
parent
7df61a8ac9
commit
dfa0a9b8eb
1 changed files with 7 additions and 7 deletions
|
@ -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', {
|
||||
if (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
|
||||
}
|
||||
}, 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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue