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

Disable while text field is focused? #14

Open
timhettler opened this issue Apr 6, 2016 · 5 comments
Open

Disable while text field is focused? #14

timhettler opened this issue Apr 6, 2016 · 5 comments

Comments

@timhettler
Copy link

Is there an easy way to globally disable keymage while an INPUT or TEXTAREA is focused?

@piranha
Copy link
Owner

piranha commented Apr 8, 2016

Not really right now, no, but I would love to see a contribution!

How do you imagine this to work? I guess it's not worth it enabling it for everyone, plus this will break users of library... Maybe an opt-in process, call keymage.preventOnInput() to do that? Any other ideas?

@orbitbot
Copy link

Would this work by attaching the default keyhandlers to a specific scope and enable/disable those with the input/textarea focus and blur events?

@piranha
Copy link
Owner

piranha commented Aug 26, 2016

Sure, it will, if a bit inconveniently. :) I remember someone (keymaster maybe?) disabling all hotkeys on inputs, but that was one of the reasons I wrote this library - I needed hotkeys working while editing textarea.

@dustingetz
Copy link

Can we unregister listeners in nested scopes?

keymage('a', 'shift ?', function() { ... }); // capture ?
keymage('a', 'myTextInput', 'shift ?', undefined); // in a text scope so let it through

@piranha
Copy link
Owner

piranha commented Aug 3, 2017

I love this idea! If you're up to implementing that, you're very welcome! If not, I guess I'll get to that sooner or later, but no real estimates right now, sorry. :)

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

4 participants