Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

KeyCode for Windows Key?

Is there a keyCode for the Windows key or a way to detect when it is pressed with Javascript or jQuery?

I've dug through StackOverflow and have found how to detect command for Mac and Ctrl and Alt for Mac and Windows, but can't find any solutions for detecting when the user presses Windows Key. Not sure if it's just a metaKey like command is but represented by the Windows Flag, or if it's even detectable at all.

like image 305
Arlo Avatar asked Oct 11 '25 17:10

Arlo


1 Answers

I ran the following js and got 91 when pressing windows key.

document.onkeydown = function(evt){ 
    console.log(evt.keyCode);
}