本文整理汇总了C++中MEvent::isModifierControl方法的典型用法代码示例。如果您正苦于以下问题:C++ MEvent::isModifierControl方法的具体用法?C++ MEvent::isModifierControl怎么用?C++ MEvent::isModifierControl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MEvent
的用法示例。
在下文中一共展示了MEvent::isModifierControl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: selection
MStatus SelectRingContext2::doPress( MEvent &event )
{
listAdjust = MGlobal::kReplaceList;
// Determine which modifier keys were pressed
if( event.isModifierShift() || event.isModifierControl() )
{
if( event.isModifierShift() )
{
if( event.isModifierControl() )
listAdjust = MGlobal::kAddToList; // Shift+Ctrl: Merge selection
else
listAdjust = MGlobal::kXORWithList; // Shift: Toggle selection (XOR)
}
else
{
if( event.isModifierControl() )
listAdjust = MGlobal::kRemoveFromList; // Ctrl: Remove selection
}
}
// Get the position of the mouse click
event.getPosition( pressX, pressY );
return MS::kSuccess;
}
示例2: doPressCommon
void marqueeContext::doPressCommon( MEvent & event )
{
// Figure out which modifier keys were pressed, and set up the
// listAdjustment parameter to reflect what to do with the selected points.
if (event.isModifierShift() || event.isModifierControl() ) {
if ( event.isModifierShift() ) {
if ( event.isModifierControl() ) {
// both shift and control pressed, merge new selections
listAdjustment = MGlobal::kAddToList;
} else {
// shift only, xor new selections with previous ones
listAdjustment = MGlobal::kXORWithList;
}
} else if ( event.isModifierControl() ) {
// control only, remove new selections from the previous list
listAdjustment = MGlobal::kRemoveFromList;
}
} else {
listAdjustment = MGlobal::kReplaceList;
}
// Extract the event information
//
event.getPosition( start_x, start_y );
}
示例3: doPress
MStatus marqueeContext::doPress( MEvent & event )
//
// Begin marquee drawing (using OpenGL)
// Get the start position of the marquee
//
{
// Figure out which modifier keys were pressed, and set up the
// listAdjustment parameter to reflect what to do with the selected points.
if (event.isModifierShift() || event.isModifierControl() ) {
if ( event.isModifierShift() ) {
if ( event.isModifierControl() ) {
// both shift and control pressed, merge new selections
listAdjustment = MGlobal::kAddToList;
} else {
// shift only, xor new selections with previous ones
listAdjustment = MGlobal::kXORWithList;
}
} else if ( event.isModifierControl() ) {
// control only, remove new selections from the previous list
listAdjustment = MGlobal::kRemoveFromList;
}
} else {
listAdjustment = MGlobal::kReplaceList;
}
// Extract the event information
//
event.getPosition( start_x, start_y );
// Enable OpenGL drawing on viewport
view = M3dView::active3dView();
view.beginGL();
#ifdef USE_SOFTWARE_OVERLAYS
p_last_x = start_x;
p_last_y = start_y;
fsDrawn = false;
#else
// If HW overlays supported then initialize the overlay plane for drawing.
view.beginOverlayDrawing();
#endif
return MS::kSuccess;
}
示例4: doPress
MStatus lassoTool::doPress( MEvent & event )
// Set up for overlay drawing, and remember our starting point
{
// Figure out which modifier keys were pressed, and set up the
// listAdjustment parameter to reflect what to do with the selected points.
if (event.isModifierShift() || event.isModifierControl() ) {
if ( event.isModifierShift() ) {
if ( event.isModifierControl() ) {
// both shift and control pressed, merge new selections
listAdjustment = MGlobal::kAddToList;
} else {
// shift only, xor new selections with previous ones
listAdjustment = MGlobal::kXORWithList;
}
} else if ( event.isModifierControl() ) {
// control only, remove new selections from the previous list
listAdjustment = MGlobal::kRemoveFromList;
}
} else {
listAdjustment = MGlobal::kReplaceList;
}
// Get the active 3D view.
//
view = M3dView::active3dView();
// Create an array to hold the lasso points. Assume no mem failures
maxSize = initialSize;
lasso = (coord*) malloc (sizeof(coord) * maxSize);
coord start;
event.getPosition( start.h, start.v );
num_points = 1;
lasso[0] = min = max = start;
firstDraw = true;
return MS::kSuccess;
}