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

Can't bind on a combo that includes a delimiter #147

Closed
daytonlowell opened this issue May 29, 2019 · 3 comments
Closed

Can't bind on a combo that includes a delimiter #147

daytonlowell opened this issue May 29, 2019 · 3 comments

Comments

@daytonlowell
Copy link
Contributor

daytonlowell commented May 29, 2019

keyboardJS.bind('mod + +', event => {
	//
})

This won't fire as one might expect because + is the delimiter. I assume the same issue would occur for 'mod > >'. Is there a work around? Should I make try to make the KeyCombo._splitStr method in key-combo.js smarter and make a PR?

@daytonlowell
Copy link
Contributor Author

Anyone have any ideas?

@tannerlyons
Copy link

This works:

keyboardJS.bind("ctrl + \\+", function() {
  console.log("oh yeah escape chars!");
});

@RobertWHurst
Copy link
Owner

@tannerlyons is correct.

If you like you can also use the alias for +, plus.

keyboardJS.bind("ctrl + plus", function() {
  // aliases work too
});

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

3 participants