keycombiner icon indicating copy to clipboard operation
keycombiner copied to clipboard

`#` key showing as an invalid key

Open pksterling opened this issue 2 years ago • 2 comments

Describe the bug Key Combiner desktop does not allow the use of # as a shortuct key

To Reproduce Steps to reproduce the behavior:

  1. Go to a collection
  2. Add a shortcut with the keys ctrl+#
  3. Find the shortcut
  4. See error: This combination will not occur in practice, because it contains invalid keys or is reserved by your web browser.

Additional context Looking through the FAQ and extended FAQ, I cannot find any reason for the # key to not work. I use the # key for a couple of shortcuts, so it would be great if it was possible to use, at least in the desktop version which I didn't expect to block any keys

pksterling avatar Mar 17 '22 09:03 pksterling

Hi, thanks for your contribution!

This is a really tricky issue that I have spent a lot of time thinking about. I still have a lot of plans for making this better.

The problem is that this key does not exist on English keyboard layouts. It also does not get recognized by most web applications as the use keyCode to process keyboard shortcuts. I have written a fairly popular blog post on the topic: Why Keyboard Shortcuts don't work on non-US Layouts and how Devs could fix it

Since other applications will not be able to process it, my thinking was that it does not make much sense to practice it with KeyCombiner. You can still record combinations with it and use whatever the recording produces, which will likely be / in place of #. You then have to mentally map / -> # during practice.

Here is a list with all valid keys: https://github.com/tkainrad/keycombiner/wiki/Valid-Key-Combinations I will add a section about keyboard layout issues and explain why the list contains only keys that are available on an English layout.

That being said, with KeyCombiner's ability to set Key Aliases in the Practice Settings, it could make sense to make it a valid key so that it is included in practice. However, you would then still need to use the Key Aliases so that KeyCombiner replaces # with whatever is detected by JavaScript processing, likely /. I will think about it!

tkainrad avatar Mar 17 '22 13:03 tkainrad

Thanks for your quick response (and for building such a useful app).

I had no idea that the hash key wasn't a standard key on the English keyboard. I've used a fair few keyboards that have the hash key (to the left of the enter key) and never realised it wasn't part of the standard - I guess it's rare that I would use the key in a way that I would realise something is wrong.

Something interesting is that the w3c keyboard event viewer shows the # key as a backslash while the app shows that I'm pushing the ' key.

Anyway, that all makes sense to me - the only problem is I can only add aliases to these five keys * ; = + / so can't add an alias for #.

Thanks for your time

pksterling avatar Mar 17 '22 14:03 pksterling