Is there a way that we can detect which side the Alt key was pressed on, i.e. distinguish between left or right Alt? I saw somewhere that it's possible with IE with the altLeft
and altRight
properties of the Event
object. If that is correct, how can we detect it in Firefox with JavaScript?
This is how it works in IE for altLeft
:
window.onload = function(){
document.getElementById('id').onkeydown = function(){
alert(window.event.altLeft);
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…