0

我的一个客户问我是否可以通过 web 应用程序完全禁用客户的键盘和鼠标。理想情况下在 jQuery 或 Html5 中。

我看到了一种方法,但只在网页上而不是整个键盘上。

4

2 回答 2

0

例如,使用AutoIt3非常简单。但是从 webapps 来说,阻止所有操作系统环境的鼠标和键盘是不可能的。

在 AutoIt3 中,这是一个示例:

; By default, AU3 add an tray icon for closing the app. No longer:
#NoTrayIcon
; For >=Vista, windows will require administrator privilleges to do that
#RequireAdmin
; Now...
BlockInput(1) ; mouse and keyboard are both lockeds!
While 1
   Sleep(100) ; loop for pause script
WEnd

只需编译并运行。

于 2012-12-16T14:44:59.130 回答
0

你有没有尝试过类似的东西

$(document).ready(function () {
    $(document).bind("keypress", function (e) {
        // Prevent any key
        return false;
    });

    $(document).bind("click", function(e) {
        // Prevent clicks
        return false;
    });
});

它应该可以工作,但不确定它是否是跨浏览器。

还添加了click处理程序。

于 2012-11-08T10:45:41.507 回答