adopted-ember-addons/ember-keyboard

Cannot listen to "+" key

marcoow opened this issue · 0 comments

It is not currently possible to listen to the + key. That's because that key is used to combine other keys and

@onKey("+")

will not actually end up matching any key and return an empty listener because of how KeyboardListener.parse works. There also doesn't seem to be a code value for the key (at least not on MDN) so it seems to be impossible to bind anything to that key atm.

I suggest treating @onKey("+") as a special case where the + is not used to connect two other keys but to literally match that actual key.

Update: Apparently + has key bode BracketRight on german keyboards which is pretty confusing. I think it'd still be nice to handle + as a special case…