Element.Event.Pseudo :keys doesn't work with resource-intensive functions #1091

Open
simon-at-fugu opened this Issue Jan 18, 2012 · 0 comments

Comments

Projects
None yet
1 participant
@simon-at-fugu

When you attach a heavy function / much code on the keydown:keys event, it don't remove the key from "pressed", because the keyup event is fired before it's attached to it:

change:

pressed.include(event.key)

if (keys.every(function(key){
    return pressed.contains(key);
})) fn.apply(this, args);

this.store(keysStoreKey, pressed);

to:

this.store(keysStoreKey, pressed.include(event.key));

if (keys.every(function(key){
    return pressed.contains(key);
})) fn.apply(this, args);

may be better....

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment