本文介绍了如何停止键盘工作。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在asp.net上创建了一个在线考试门户。在这个门户用户只能通过鼠标虚拟键盘插入字符,我已经应用了一个在几台机器上工作正常的脚本。键盘完全停止工作,但在学校实验室有些系统经过长按任意键然后返回空间2次用户可以使用键盘。如何阻止键盘工作特别alt + tab和windows键,我无法弄清楚出现了什么问题,相同的代码在某些代码上正常工在这里预先感谢脚本,



I've made an online examination portal in asp.net .In this portal user can insert characters only by virtual keyboard by mouse, I have applied a script which is working fine on several machine. Keyboard is totally stop working, but in school labs some system after long press any key and then back space 2 times user able to use keyboard.How to block keyboard working specially alt+tab and windows key, I'm not able to figure out what problem is occurring same code working fine on some and some not. Thanks in advance script is here,

<script>
            document.onkeydown = function (ev) {
                var key;
                ev = ev || event;
                key = ev.keyCode;
                ev.cancelBubble = true;
                ev.returnValue = false;
            }
</script>

推荐答案


这篇关于如何停止键盘工作。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 06:29