Skip to content

Loading…

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

Open
simon-at-fugu opened this Issue · 0 comments

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
Something went wrong with that request. Please try again.