dragging = false; removeListener(SWT.DragDetect, listener); dragDetect = detectDrag(event.x, event.y, event.button); if (dragDetect) { addListener(SWT.DragDetect, listener); return; }  mouseDown = true;
void handleMouseDown(Event event) {	mouseDown = true;	mouseDoubleClick = false;		//force focus (object support)	forceFocus();		if (event.button == 2) {		String text = (String)getClipboardContent(DND.SELECTION_CLIPBOARD);		if (text != null && text.length() > 0) {			// position cursor			doMouseLocationChange(event.x, event.y, false);			// insert text			Event e = new Event();			e.start = selection.x;			e.end = selection.y;			e.text = getModelDelimitedText(text);			sendKeyEvent(e);		}	}	if ((event.button != 1) || (IS_CARBON && (event.stateMask & SWT.MOD4) != 0)) {		return;		}	boolean select = (event.stateMask & SWT.MOD2) != 0;	doMouseLocationChange(event.x, event.y, select);}