Using Adobe InDesign's extendscript (javascript language), how can I add an onClick function for both left AND right click events?
Adding the left-click event is easy. How do I add the right-click event?
[post answer update (much thanks to Josh Voights for finding that)]
If anyone is interested, I wanted to use this in such a way to apply the handler to the button like this, which works perfectly:
whatbutton.addEventListener("click", function(p){
    if(!p.shiftKey){
        if (p.button ==2) {
            alert("right click");
        }else{
            alert("left click");
        }
    }else{
        if (p.button ==2) {
            alert("shift right click");
        }else{
            alert("shift left click");
        }
    }