keyboard events - javascript alt key -


We are creating a web user interface that looks like a desktop window. Now we have to handle the alt key. When the Alt key is pressed, the focus goes to the upper menu.

In JavaScript, how to get an event for the alt key when only Alt is pressed? I need to make sure that no other key is pressed at the same time.

Thanks in advance.

Maybe it's like

  document.onkeydown = keydown; Function KeyDown (EVT) {if (! Evt) evt = event; If (evt.altKey) {alert ('alt'); }} // function keydown (eivalt) a ????    

Comments