I have an aspx application that provides online testing. The customer wants
to disallow the student from hitting certain keystrokes like ALT-TAB, or
PrintScrn, or CTRL-C so that they cannot take a copy of the test question and
paste it into another document. Or use ALT-TAB to get back to the desktop to
look up answers.
I launch IE full screen no toolbars to give it the appearance that you are
sort of locked down. Is there a way using script on the web page to capture
certain keystrokes and not allow them to be sent to the OS?
EradicusMax - 20 Oct 2004 06:09 GMT
Yes, the onKeyPress event handler can do what you want.
Attach to the body, element etc., below handles the ctrl+C
MyKeyPress()
{
if(event.keyCode==67 && event.ctrlKey)
{
event.returnValue=false;
return;
}
}
> I have an aspx application that provides online testing. The customer wants
> to disallow the student from hitting certain keystrokes like ALT-TAB, or
[quoted text clipped - 4 lines]
> sort of locked down. Is there a way using script on the web page to capture
> certain keystrokes and not allow them to be sent to the OS?