Right-click capture through Javascript, withouth wmode

The Flash player has an error in using anything other than wmode = "window" in Firefox / Chrome if any language other than English is used. This error is reported and not yet fixed.

http://bugs.adobe.com/jira/browse/FP-501

The problem here is better visible -

http://www.5etdemi.com/blog/archives/2005/06/firefox-wmodetransparent-is-completely-screwy-and-breaks-textfields/

Now, to my problem, I am trying to use the right mouse button solution ( http://www.uza.lt/blog/2007/08/solved-right-click-in-as3) in my application, but I am stuck in the wmode problem. Event capture does not seem to work with wmode = "window", and I need several languages ​​to work with my application.

Is there any solution for this that anyone has defined? Or is there a way that you can right-click without installing wmode.

Any help would be greatly appreciated. Thanks!!

+2
source share
1 answer

Fortunately, you most often want to know if the right button has been pressed. Since W3C and Microsoft agree to this, and give the button a value of 2, you can still find the right click.

function doSomething(e) {
    var rightclick;
    if (!e) var e = window.event;
    if (e.which) rightclick = (e.which == 3);
    else if (e.button) rightclick = (e.button == 2);
    alert('Rightclick: ' + rightclick); // true or false
}

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

http://www.quirksmode.org/js/events_properties.html

http://unixpapa.com/js/mouse.html http://www.javascripter.net/faq/leftvsri.htm

0
source

Source: https://habr.com/ru/post/1709064/


All Articles