title: Right Click Detection for Firefox
body: <p>Before beginning, I am not inquiring about stopping users from right-clicking. This is for right-click detection on a html5 canvas.</p>
  
  <p>So currently, what I have is:</p>
  
  <pre><code>
    function init() {
     var canvas = document.getElementById('canvasID');\
     if (canvas.getContext) {
      ctx = canvas.getContext('2d');
      ctx.font = '10px sans-serif';
      ctx.canvas.onmousedown=ctx.canvas.onclick=onMousePressed;
      ctx.canvas.onmouseup=ctx.canvas.onmouseout=onMouseReleased;
      ctx.canvas.onmousemove = onMouseMove;
     }
    }
  </code></pre>
  
  <p>And also:
  <pre><code>
        function onMouseMove(e) {
     if (mouseDown) {
      click2 = convertCoordsToTileCoords({
       x: e.offsetX || e.layerX - this.style.left,
       y: e.offsetY || e.layerY - this.style.top
      });
      var rightclick;
      if (!e) e = window.event;
      if (e.which) rightclick = (e.which == 3);
      else if (e.button) rightclick = (e.button == 2);
  </pre></code>
  ..etc<br />
  Where the variable 'rightclick' is a boolean, resulting in true if the person is right clicking.</p>
  
  <p>Which browsers this works for:
  Chrome</p>
  
  <p>Opera, no, because of their mouse gestures and stuff.
  IE, no, because of canvas.
  But I cannot figure out why it will not work on Firefox.</p>
  
  <p>As usual, if there is a better, more efficient, method of tackling this problem, it would be highly appreciated.</p>
  
  <p>-Firstmate</p>
  
  <p>Edit1: Provided more code.</p>