Closed gossi closed 6 years ago
The handleEvent
of key-manager debounces - why? This should be up to the implementation of the callback to do this.
I hacked it that way:
import KeyManagerService from 'ember-key-manager/services/key-manager';
export default KeyManagerService.extend({
handleEvent(event) {
const isServiceDestroyed = this.get('isDestroyed') || this.get('isDestroying');
if (isServiceDestroyed) {
return false;
}
this.set('event', event);
this._handleEvent();
}
});
Also affects #34
So I think the debounce
is preventing the callback from getting fired repeatedly. I'll take a look and probably will just take it out all together. @gossi we do want to have the repeated fire be something the app specifies when adding the macro - allowRepeat = true
defaults to true.
Sounds great, since repeatedly firing is the default when adding keyevents using standard dom APIs, having it behave like that is great.
In a regular event listener
elem.addEventListener('keydown', ....)
after a system delay consecutive keydowns will be fired, when the key is hold by the user. At the moment with the macros one and exactly one callback is fired and the consecutive keydown callbacks are missing. Am I doing something wrong?