Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable keyboard actions

Status
Not open for further replies.

sqlwp

Programmer
Joined
Jan 23, 2004
Messages
24
Location
US
Is there any way to prevent the action of the Windows key and the print screen key?
 
Maybe with some low level keyboard driver or with some good keyboardhook Procedure.
You would need to have an application not an asp :)

________
George, M
 
Can you do it in VB?
 
You can do it in VB also.
You would need to use "SetWindowsHookEx" method to install an keyboard hook.

________
George, M
 
Do you know of an example of one somewhere?
 
This will stop 'some' users:



<html>


<body onHelp=&quot;alert('Please Do Not Use The Keyboard.'); event.returnValue=false; return false;&quot;>

<script language=&quot;JavaScript&quot;>
<!--

document.oncontextmenu=new Function(&quot;event.returnValue=false; return false;&quot;)
document.onselectstart=new Function(&quot;event.returnValue=false; return false;&quot;)
document.onCopy=new Function(&quot;event.returnValue=false; return false;&quot;)
document.onPaste=new Function(&quot;event.returnValue=false; return false;&quot;)
document.ondragstart=new Function(&quot;event.returnValue=false; return false;&quot;)
document.onkeydown=new Function(&quot;alert('Please Do Not Use The Keyboard.'); event.returnValue=false; return false;&quot;)
document.onKeypress=new Function(&quot;alert('Please Do Not Use The Keyboard.'); event.returnValue=false; return false;&quot;)
document.onKeyup=new Function(&quot;alert('Please Do Not Use The Keyboard.'); event.returnValue=false; return false;&quot;)
document.onselect=new Function(&quot;event.returnValue=false; return false;&quot;)
document.ondragdrop=new Function(&quot;event.returnValue=false; return false;&quot;)
document.onmousedown=new Function(&quot;event.returnValue=false; return false;&quot;)

// -->
</script>

Press some keys . . .

</body>
</html>

hth,
Foxbox
ttmug.gif
 
It doesn't seem to stop the MS Windows key.
 
You cannot effectively stop the keys being pressed within a browser - all of foxbox's suggestions are disabled by turning javascript off.

 
Looks like sqlwp's aim is to prevent browsers from copying images from the web pages.
Good luck! You could be the first ever to solve this. :-)

Medic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top