Skip to content
This repository has been archived by the owner on Nov 8, 2017. It is now read-only.

Enable distinguishing of casing #25

Open
creage opened this issue Oct 18, 2012 · 4 comments
Open

Enable distinguishing of casing #25

creage opened this issue Oct 18, 2012 · 4 comments

Comments

@creage
Copy link

creage commented Oct 18, 2012

Well, imagine you have a binding like "Q", and "q" - both of them are fired by hitting "Q" key on your keyboard.

But if you somehow display these keys on the screen of your app - users type shift+q to match the uppercase "Q", and just q for lowercase "q".

Hence, it would be nice if jwerty could detect shift+key, if bound key IS IN uppercase.

@keithamus
Copy link
Owner

There are lots of edge-cases to this that would require looking at. It would be a nice to have but not a priority, unless you want to submit a PR?

@creage
Copy link
Author

creage commented Oct 18, 2012

Currently I see that jwerty is explicitly lowercases all of codes. What if we just leave all of codes as users bind them?

@keithamus
Copy link
Owner

It lowercases codes to make selection of said codes easier. If you jwerty.key("shift+q"... it should fire on those to keys pressed in combination, its a little ambiguious to use jwerty.key("Q"... or jwerty.key("q", as it can be prone to errors or typos (other typos could include jwerty.key("Shift+q"...

Also there is a case where if the caps-lock is on, what key does it fire? Q or q?

@creage
Copy link
Author

creage commented Oct 19, 2012

OK. For now I'm dealing like this

if (key == key.toUpperCase()) {
key = key + "/shift+" + key;
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants