0

I've been trying to use event.metaKey, but I can't capture it (the ctrl, shift and alt versions work perfectly). I use the following script to catch it and it want it to evaluate to true when when I press the Windows button.

document.onkeydown = function (event) {
   alert(event.metaKey);
}

Link.

It's hinted that it doesn't work in another question. Is there any way to make it work? edit: I don't know whether it matters, but I only need it to work for firefox (addon).

Community
  • 1
  • 1
Kvothe
  • 386
  • 2
  • 8
  • 2
    You are very unlikely to implement usage of the Windows key cross-browser. I'd use a different key. – Mitya Apr 01 '14 at 21:10
  • I only need it to work for firefox (it's an addon) and I really need the amount of permutations four modifier keys give me. – Kvothe Apr 01 '14 at 21:15
  • @Kvothe In Firefox under Linux you can use `event.keyCode == 0` to detect that Win is pressed, but I'm not sure if it will work for a modifier key. See [here](http://unixpapa.com/js/key.html) for more details. – Andrey Apr 01 '14 at 21:54

0 Answers0