Click here to Skip to main content
15,920,031 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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,

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

1 solution

 
Share this answer
 
v2
Comments
arifk786k 19-Jan-15 23:38pm    
i want to stop not for any specific control. keyboard's any key should not work

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900