cancel
Showing results for 
Search instead for 
Did you mean: 

Deactivate right mouse button

Former Member
0 Kudos

How can I deactivate the effect of a click on the right mouse button on a page with flow logic?.

Thanks in advance,

Ruben.

Accepted Solutions (1)

Accepted Solutions (1)

former_member181879
Active Contributor
0 Kudos

Right mouse button probably means out there in your browser. This is HTML and Javascript. It plays no role whether the page was assembled with MVC or older pages.

As for you question, just ask your favourite search engine. Typical keywords could be "JavaScript right mouse button". One of the first links I saw, was:

http://www.rgagnon.com/jsdetails/js-0061.html

There are thousands more!

Former Member
0 Kudos

Antoher one for you that I have used inside my BSP's before:

http://www.dynamicdrive.com/dynamicindex9/noright.htm

Answers (1)

Answers (1)

Former Member
0 Kudos

Here you got an example:


<head>
...
<script>
function right(e) {
if (navigator.appName == 'Netscape' && 
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' && 
(event.button == 2 || event.button == 3)) {
alert("Sorry, you do not have permission to right click.");
return false;
}
return true;
}

document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;

</script>
...
</head>