コード例 #1
0
void GraphNodeHandler::mouseDown(ci::app::MouseEvent &event)
{
    if (glm::length(*position - ci::vec2(event.getPos())) < size)
    {
        if (event.isAltDown())
        {
            if (selection == Selection::addEdge)
            {
                selection = Selection::none;
            }
            else
            {
                selection = Selection::addEdge;
                selectedInFrame = ci::app::getElapsedFrames();
            }

        }
        else
        {
            selection = Selection::move;
        }
        event.setHandled(true);
    }
    else
    {
        if (selection == Selection::move)
            selection = Selection::none;
    }
}
コード例 #2
0
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);
	}
}
コード例 #3
0
void SpawnObjectApp::mouseDrag( ci::app::MouseEvent event )
{
    if( event.isAltDown() )
        mMayaCam.mouseDrag( event.getPos(), event.isLeftDown(), event.isMiddleDown(), event.isRightDown() );
}
コード例 #4
0
void SpawnObjectApp::mouseDown( ci::app::MouseEvent event )
{
    if( event.isAltDown() )
        mMayaCam.mouseDown( event.getPos() );
}