Skip to Content
author's profile photo Former Member
Former Member

Deactivate right mouse button

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

Thanks in advance,

Ruben.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Feb 16, 2005 at 10:16 PM

    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!

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 17, 2005 at 10:49 AM

    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>
    

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.