IcarusWorks / ember-key-manager

A service for (un)binding keyboard up and down events.
MIT License
42 stars 11 forks source link

global listeners, except text inputs #5

Closed gossi closed 7 years ago

gossi commented 7 years ago

At the moment I'm using my own method for listening on key events globally. This interferes with text inputs where I pause and resume my global listener on their focus and blur events. I do this manually. Can your plugin help me with that? That this will ignore key events on text inputs, when global once are registered?

patrickberkeley commented 7 years ago

@gossi we don't currently expose an option to disable/enable shortcuts based on whether or not there is a focused textarea or input. We manage this on a one-off basis per shortcut by checking document.activeElement.

I'd be interested in adding this as a feature. Would you find it more useful to be able to globally disable shortcuts any time an input has focus? Or would you want to be able to granularly disable per shortcut?

gossi commented 7 years ago

Cool! For me particular, a global option would be nice. However, since this is a general purpose plugin, both options should be available, you never know how one will be using your plugin.

patrickberkeley commented 7 years ago

Gotcha. Thanks for the info!

jordpo commented 7 years ago

Closing this as we have merged the updates with the global config and register flag to disable when an input element is active.

patrickberkeley commented 7 years ago

@gossi please let me know if the new option works for you.

gossi commented 7 years ago

I just implemented it and it's a bless. I love you guys! Awesome job.