ericwoodruff / passwordhasherplus

Password Hasher Plus
http://goo.gl/LyLk3
Other
12 stars 21 forks source link

Ctrl-# not working on non-US keyboards #9

Closed Technium closed 10 years ago

Technium commented 12 years ago

Took me a while to work out if the keyboard short-cuts were supposed to be working, but I'm pretty sure you believe they are.

On a hunch I tried the location of # on a US keyboard (it's a £ on a UK one) and finally saw it work. So, I guess the code you have there isn't aware of different keyboard layouts...

Technium commented 12 years ago

On some investigation it seems javascript keyCodes are a total mess.

For reference, on a UK keyboard the "£" is a shifted 3 while a "#" is an unshifted key of its own that lives right next to the return key. See Wikipedia.

Testing with my "£" and "#" keys shows they both send the same keyCode of "3", with and without shiftKey set, respectively. There is simply no way to differentiate between the lone "3" key and the lone "#" key on my keyboard using the standard keydown handler.

Checking the keypress handler shows it also includes the layout-correct charCode, but is not fired at all when used with Ctrl.

There doesn't appear to be an elegant solution. Best route I can see is to extend the options page to allow user configurable keyboard shortcuts.

turkeyphant commented 10 years ago

Yes please.

jowi24 commented 10 years ago

I can confirm this behaviour. Do you plan to fix this or do you accept patches for this issue?

ericwoodruff commented 10 years ago

I would accept patches On Aug 25, 2014 6:55 AM, "Joachim Wilke" notifications@github.com wrote:

I can confirm this behaviour. Do you plan to fix this or do you accept patches for this issue?

— Reply to this email directly or view it on GitHub https://github.com/ericwoodruff/passwordhasherplus/issues/9#issuecomment-53266300 .

ericwoodruff commented 10 years ago

Closing per the pull request. Thanks!