dmauro / Keypress

A keyboard input capturing utility in which any key can be a modifier key.
http://dmauro.github.io/Keypress/
Apache License 2.0
3.18k stars 313 forks source link

unregister_many can use the results of register_many to unregister combos #31

Closed pelly closed 10 years ago

pelly commented 10 years ago

It would be nice to allow unregister_many to undo the results of register_many by just feeding the results of register_many back into it:

  registered1 = listener.register_many(some_combos)
  registered2 = listener.register_many(some_other_combos)

  listener.unregister_many(registered1) // now listener only has some_other_combos registered

I just made a simple change where register_combo returns the combo object instead of "true" - is that OK? A cursory glance didn't show anyplace where the return value of register_combo is needed/used.

I added a test as well that exercises the functionality.

I love the library overall - it's been really helpful for my projects!

dmauro commented 10 years ago

I'm going to merge this into development instead. Thank you.

pelly commented 10 years ago

Sure no problem. Sorry, never done a pull request before.

On Tue, Feb 11, 2014 at 1:57 PM, David Mauro notifications@github.comwrote:

I'm going to merge this into development instead. Thank you.

Reply to this email directly or view it on GitHubhttps://github.com/dmauro/Keypress/pull/31#issuecomment-34791397 .

dmauro commented 10 years ago

Oh no that was my fault. I should have changed the default branch to development. It's done now :)