OscarGodson / jKey

Key shortcuts made simple
http://oscargodson.github.com/jKey/
185 stars 40 forks source link

Unbinding jKey events #12

Open vala opened 12 years ago

vala commented 12 years ago

Hi there,

I'd just wanted to point out that there's no explanation on how to unbind a jKey event, although I found it easily looking at your code, it may be something good to just write it somewhere in the README file or maybe making a more "clean" way to do it. For now I made it this way

$(element).unbind('keydown.jkey');

For me it's all right, but it implies that I unbind every key event associated to element If you're ok with patches I'd be pleased to write one in order to implement some way to make it possible to unbind specifical key events, in order to do something like that :

$(element).jkey('unbind', 'left, right');

Thanks for the plug, works really well!

Cheers

OscarGodson commented 12 years ago

That would rock! There was a guy a few months back who tried to patch it also but no avail on his end. If you could do this that'd be great. It's for sure the number 1 thing missing right now from jKey.

vala commented 12 years ago

Fine, I'll be on it. I'll fork your repo this night and be patching it !

OscarGodson commented 12 years ago

Hooray! We'll all be cheering you on ;)

hooray

vala commented 12 years ago

Heh thanks for the pic, I really feel supported ! I don't got enough time today to finiss it but I got my solution, It may be quite an overkill but tomorrow I'll be pushing it so you can review it and maybe find where it can be optimized, it'll make me change a bit the way callbacks are called but I think it will be ok. I'll keep you up