JS获取键盘信息
Admin | 2015-9-11 9:19:37 | 被阅次数 | 3118
JS获取键盘的信息,功能代码如下:
var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
var service = locator.ConnectServer(".");
var properties = service.ExecQuery("SELECT * FROM Win32_Keyboard");
var e = new Enumerator (properties);
document.write("<table border=1>");
for (;!e.atEnd();e.moveNext ())
{
var p = e.item ();
document.write("<tr>");
document.write("<td>" + p.Description + "</td>");
document.write("<td>" + p.Name + "</td>");
document.write("<td>" + p.Status + "</td>");
document.write("</tr>");
}
document.write("</table>");