def onMouseDown(self, sender, x, y):
        """
        * Most browsers, by default, support the ability to
        * to "drag-copy" any web page image to the desktop.
        * But GChart's rendering makes extensive use of
        * images, so we need to override this default.
        *
        """
        event = DOM.eventGetCurrentEvent()
        DOM.eventPreventDefault(event)
        self.ctrlPressed = DOM.eventGetCtrlKey(event)
        self.altPressed = DOM.eventGetAltKey(event)
        x = self.getXAxis().getMouseCoordinate()
        y = self.getYAxis().getMouseCoordinate()
        if (min(self.p1.x, self.p2.x) <= x  and 
            x <= max(self.p1.x, self.p2.x)  and  
            min(self.p1.y, self.p2.y) <= y  and  
            y <= max(self.p1.y, self.p2.y)):
            return; # ignore mouse down inside selection rectangle
        
        self.p1.x = self.p2.x = x
        self.p1.y = self.p2.y = y
        xMin = self.getXAxis().getAxisMin()
        xMax = self.getXAxis().getAxisMax()
        yMin = self.getYAxis().getAxisMin()
        yMax = self.getYAxis().getAxisMax()
        self.initialPlotRegion.xMin = xMin
        self.initialPlotRegion.xMax = xMax
        self.initialPlotRegion.yMin = yMin
        self.initialPlotRegion.yMax = yMax
        if self.ctrlPressed:
            self.selecting = True
            self.moving = False
        else:
            self.selecting = False
            self.moving = True
        
        self.updateCursor()
dataset/ETHPy150Open anandology/pyjamas/examples/gcharttestapp/GChartExample24.py/GChartExample24.onMouseDown/original