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

Prevent cheet event on text areas #14

Closed
fuyangli opened this issue Nov 8, 2015 · 3 comments
Closed

Prevent cheet event on text areas #14

fuyangli opened this issue Nov 8, 2015 · 3 comments

Comments

@fuyangli
Copy link

fuyangli commented Nov 8, 2015

Is there a way to prevent the event if the user is typing something on a text area?

@namuol
Copy link
Owner

namuol commented Nov 9, 2015

Try something like this:

function activateGodMode() {
  alert('god mode enabled!');
}

cheet('i d d q d', activateGodMode);

textArea.on('focus', function () {
  cheet.disable('i d d q d')
});

textArea.on('blur', function () {
  cheet('i d d q d', activateGodMode);
});

@namuol namuol closed this as completed Nov 9, 2015
@fuyangli
Copy link
Author

fuyangli commented Nov 9, 2015

Thanks!
This lib is awesome :D

@namuol
Copy link
Owner

namuol commented Nov 9, 2015

Thanks for the kind words 😄 -- hope that helps

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