Catch Mouse and Key

[Total: 0    Average: 0/5]

Catch alt, shift or ctrl key (when the mouse is clicked).

Body Code:

<SCRIPT language=JavaScript>
function click() {
/* IE only */
if (event.altKey==true) 
alert('Alt + mouse button were preessed !');
if (event.shiftKey==true) 
alert('Shift + mouse button were pressed !');
if (event.ctrlKey==true) 
alert('Cntrl + mouse button were pressed !');
}
document.onmousedown=click
</SCRIPT>
Press 'Alt' or 'Ctrl' or 'Shift' + any mouse button 

Times Viewed: 3

Leave a Reply

Your email address will not be published. Required fields are marked *