Checking whether a click event was triggered by physically mouse clicking or not?
<p>I have a button, and I decided to trigger that button:</p>

<pre><code>$(button_name).trigger("click");
</code></pre>

<p>The handler of the function requires that the left button triggers the click when triggering using the mouse, but also does accepts clicks by triggering using code, like the line shown above. How can I create a conditional statement which evaluates if such conditions are true?</p>

<pre><code>if((navigator.appName === "Microsoft Internet Explorer" &amp;&amp; window.event.button === 1) 
    || window.event.button == 0
    || ...){

    /* If true, do this */
}
</code></pre>
