<html>
<body>
<input type="text" id="tt" />
<script language="javascript" type="text/javascript">
document.getElementById('tt').onfocus = function(){
var shell = new ActiveXObject("wscript.shell")
shell.run("osk.exe")
}
</script>
</body>
</html>
我知道:
这个只能在IE浏览器实现,而且需要设定IE的安全级别,允许浏览器加载ActiveXObject控件,如图。
如果不用系统自带的软键盘,可以用js实现。网上找到一个js写的。你可以看看
case 96:keyName = e.keyCode+"[小键盘区0]"breakcase 97:keyName = e.keyCode+"[小键盘区1]"break
case 98:keyName = e.keyCode+"[小键盘区2]"break
case 99:keyName = e.keyCode+"[小键盘区3]"break
case 100:keyName = e.keyCode+"[小键盘区4]"break
case 101:keyName = e.keyCode+"[小键盘区5]"break
case 102:keyName = e.keyCode+"[小键盘区6]"break
case 103:keyName = e.keyCode+"[小键盘区7]"break
case 104:keyName = e.keyCode+"[小键盘区8]"break
case 105:keyName = e.keyCode+"[小键盘区9]"break
软键盘数值不一样,JS代码自然不能用