本文整理汇总了C++中ci::app::MouseEvent::isShiftDown方法的典型用法代码示例。如果您正苦于以下问题:C++ MouseEvent::isShiftDown方法的具体用法?C++ MouseEvent::isShiftDown怎么用?C++ MouseEvent::isShiftDown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ci::app::MouseEvent
的用法示例。
在下文中一共展示了MouseEvent::isShiftDown方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mouseDown
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);
}
}
示例2: mouseDrag
void RibbonPaint::mouseDrag( ci::app::MouseEvent event )
{
if(_state != kStateNormal) return;
// Not drawing lines, clear the frame
if(_drawLines == false)
ci::gl::clear( _clearColor );
// invisible if shift is helpd down
if( event.isShiftDown() )
{
// Store it the first time
if(_alphaWhenDrawing > 0) {
_oldAlphaWhenDrawing = _alphaWhenDrawing;
}
// make zero until they let go, or mouse up
_alphaWhenDrawing = 0;
} else {
_alphaWhenDrawing = _oldAlphaWhenDrawing;
}
// start drawing lines
_mousePosition = event.getPos();
_drawLines = true;
}