code: function( e, rightclick )
          {
              // mouse position
              var clientX = null,
                  clientY = null;
              if( e.clientX && e.clientY )
              {
                  clientX = e.clientX;
                  clientY = e.clientY;
              }
              else if( e.pageX && e.pageY )
              {
                  clientX = e.pageX - window.pageXOffset;
                  clientY = e.pageY - window.pageYOffset;
              }
              // mouse button
              if( e.which && e.which == 3 )
                  rightclick = true;
              else if( e.button && e.button == 2 )
                  rightclick = true;
  
              // remove event handler
              removeEvent( window, 'mouseup', mouseHandler );
              // Callback selection
              if( popup_saved_selection )
                  popup_saved_selection = saveSelection( node_contenteditable );
              if( ! hijackContextmenu && rightclick )
                  return;
              if( debounced_handleSelection )
                  debounced_handleSelection( clientX, clientY, rightclick );
          }
docs: Mouse events