Dafrok/v-hotkey

mac vs windows keys

CavalcanteLeo opened this issue · 1 comments

We have some differences between mac and windows
For example, on mac we usually type cmd, but control on windows.
How is this lib handling these differences?

I don't have a windows pc, then i cannot test it.
But i want to create a shortcut like:

mac: cmd+shif+a
win: ctrl+shif+a

Is this handled automatically or do i need to handle it by myself?

@CavalcanteLeo If you check here to see the number of the key (event.which), you can see that cmd and ctrl are different code, but control and ctrl are the same, which means that macOS and Windows threat those the differently event though the browsers sees them the same.

And that is what matters, in browsers environment ctrl+shift+a is the same for all platforms. cmd key is treated as meta key. You can add these shortcut but, ctrl+shift+a will be triggered in all OSes.