IcarusWorks / ember-key-manager

A service for (un)binding keyboard up and down events.
MIT License
42 stars 11 forks source link

Add alias to `meta` and `metaRight` to make OS agnostic #8

Closed gossi closed 7 years ago

gossi commented 7 years ago

I was wondering whether to use a meta key for the shortcut, which responds to cmd on mac rsp. windows on win and "super" on linux. The javascript KeyEvent already supports the meta key.

patrickberkeley commented 7 years ago

We have it setup to map the keycodes for command and window keys to:

Source: https://github.com/IcarusWorks/ember-key-manager/blob/master/addon/utils/key-codes.js#L74-L77

So you can use either the windows or mac naming in your code and the mapping should work.

Does that answer what you need?

gossi commented 7 years ago

Ah yes, I didn't compare the keycodes. Nevertheless I think adding meta as alias is good. Using only win or mac terminology doesn't make the code look os-independent.

patrickberkeley commented 7 years ago

👍 on aliasing

patrickberkeley commented 7 years ago

@gossi fwiw this was released in 0.1.5