mousetrap icon indicating copy to clipboard operation
mousetrap copied to clipboard

Capitalized keybindings work for binds registered with "keypress" action but not for "keydown" action

Open mgsloan opened this issue 5 years ago • 0 comments

Just letting you know about this inconsistency! If I bind keypress actions specified with an uppercase character, like "H", it works. However, if I bind "keydown" actions, these bindings do not work, instead I have to use "h".

Why am I using keydown instead of keypress? Well, recently I encountered some funky behavior where the keypress handler wasn't working in firefox - I suspect that this was a change in behavior the site that I am extending - https://github.com/mgsloan/todoist-shortcuts/issues/40 - so that probably not a mousetrap issue. Curiously, I still got key repeat even when using "keydown" actions, which was surprising.

Sorry for not including a more direct repro in this issue report. This is more of letting folks know there's an issue like this - the workaround for me was quite straightforward. Instead I just use shift+lower instead of the uppercase form of the keybinding.

Note that I have a modified version of mousetrap. However, I am pretty confident that this is not due to any You might be interested in what I've added, let me know if I should open some PRs - https://github.com/ccampbell/mousetrap/compare/master...mgsloan:master

mgsloan avatar Aug 28 '18 04:08 mgsloan