<div class="codetitle"> <span><a style="CURSOR: pointer" data="12763" class="copybut" id="copybut12763" onclick="doCopy('code12763')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code12763"> <br>document.onclick = function(e){ <br>alert(getKey(e)); <br>}; <br>function getKey(e){ <br>var e = e || window.event; <br>var keys = []; <br><br>if(e.shiftKey){ <br>keys.push("shift键"); <br>}; <br>if(e.ctrlKey){ <br>keys.push("ctrl键"); <br>}; <br>if(e.altKey){ <br>keys.push("alt键"); <br>}; <br>return keys; <br>}; <br> </div>