VBscript键盘事件问题

来源:百度知道 编辑:UC知道 时间:2024/04/29 23:38:13
<html><head></head><body onkeydown="KeyDown()">
<script language="VBscript">
function KeyDown()
If KeyCode = vbKeyA Then
MsgBox "You pressed the A key."
End if
End function
</Script> <BODY> </HTML>
这个代码为什么不管按下什么键都会跳出提示?
用ASCII,代码不知道怎么写
我试过用keyAscii=65 好象不行

<html>
<head></head>
<body onkeydown="KeyDown()">
<script language="VBscript">
function KeyDown()
If window.event.keyCode =65 Then
MsgBox "You pressed the A key."
End if
End function
</script>
</body>
</html>

是不是转为ASC代码试试..
KeyCode = 65 或 97