Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unregistering 'any' key #16

Open
antag0n1st opened this issue Jan 26, 2015 · 2 comments
Open

Unregistering 'any' key #16

antag0n1st opened this issue Jan 26, 2015 · 2 comments

Comments

@antag0n1st
Copy link

After unregistering all the keys

kibo.down('any',null);
kibo.up('any',null);

I get:

kibo.js:181 Uncaught TypeError: Cannot read property 'length' of undefined

@marquete
Copy link
Owner

Hi, @antag0n1st! Thank you for reporting this - I'm so sorry I haven't been able to take care of it yet.

I was just going to replace this:

if(func === null)
  delete registeredKeys[keys];

... with something like this:

if(func === null)
  registeredKeys[keys].length = 0;

But then I reread the issue and it occurred to me that you'd expect different behaviour. Was your intention to unregister all functions registered specifically under the 'any' key, or to unregister all functions for all keys? I think the latter makes more sense, though the former is currently implemented. Then it would also make sense that unregistering 'any letter' should also unregister keys 'a' to 'z', wouldn't it? And the same for the other wildcards.

Thanks, and again, my apologies about the delay.

@antag0n1st
Copy link
Author

Yes , it should unregister all previously registered keys , the 'any' keyword should not be treated as a special key , but as a wildcard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants