void TouchDebug::mouseDown(const ci::app::MouseEvent& e) { mReplicating = false; if(e.isAltDown()) { if(!mDropTouched){ mEngine.mouseTouchBegin(e, mTouchId + 2); mDropTouched = true; } else { mEngine.mouseTouchEnded(e, mTouchId + 2); mDropTouched = false; } } else if(e.isShiftDown()) { mReplicating = true; replicate(e, ds::ui::TouchInfo::Added); } else if(e.isControlDown()){ if(mTwoTouching){ mTwoTouching = false; } else { mTwoTouching = true; mTwoTouchDown = e.getPos(); } } else if(mTwoTouching){ mEngine.mouseTouchBegin(e, mTouchId); int deltaX = e.getPos().x - mTwoTouchDown.x; int deltaY = e.getPos().y - mTwoTouchDown.y; ci::app::MouseEvent mouseTwo = ci::app::MouseEvent(e.getWindow(), 0, mTwoTouchDown.x - deltaX, mTwoTouchDown.y - deltaY, e.getNativeModifiers(), e.getWheelIncrement(), e.getNativeModifiers()); mEngine.mouseTouchBegin(mouseTwo, mTouchId + 1); } else { mEngine.mouseTouchBegin(e, mTouchId); } }
void TouchDebug::mouseDrag(const ci::app::MouseEvent& e) { if(mReplicating){ replicate(e, ds::ui::TouchInfo::Moved); } else if(mTwoTouching){ mEngine.mouseTouchMoved(e, mTouchId); int deltaX = e.getPos().x - mTwoTouchDown.x; int deltaY = e.getPos().y - mTwoTouchDown.y; ci::app::MouseEvent mouseTwo = ci::app::MouseEvent(e.getWindow(), 0, mTwoTouchDown.x - deltaX, mTwoTouchDown.y - deltaY, e.getNativeModifiers(), e.getWheelIncrement(), e.getNativeModifiers()); mEngine.mouseTouchMoved(mouseTwo, mTouchId + 1); } else { mEngine.mouseTouchMoved(e, mTouchId); } }