本文整理汇总了C++中ModifierKeys::isShiftDown方法的典型用法代码示例。如果您正苦于以下问题:C++ ModifierKeys::isShiftDown方法的具体用法?C++ ModifierKeys::isShiftDown怎么用?C++ ModifierKeys::isShiftDown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModifierKeys
的用法示例。
在下文中一共展示了ModifierKeys::isShiftDown方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: selectBasedOnModifiers
void selectBasedOnModifiers (TreeViewItem* const item, const ModifierKeys& modifiers)
{
TreeViewItem* firstSelected = 0;
if (modifiers.isShiftDown() && ((firstSelected = owner.getSelectedItem (0)) != 0))
{
TreeViewItem* const lastSelected = owner.getSelectedItem (owner.getNumSelectedItems() - 1);
jassert (lastSelected != 0);
int rowStart = firstSelected->getRowNumberInTree();
int rowEnd = lastSelected->getRowNumberInTree();
if (rowStart > rowEnd)
swapVariables (rowStart, rowEnd);
int ourRow = item->getRowNumberInTree();
int otherEnd = ourRow < rowEnd ? rowStart : rowEnd;
if (ourRow > otherEnd)
swapVariables (ourRow, otherEnd);
for (int i = ourRow; i <= otherEnd; ++i)
owner.getItemOnRow (i)->setSelected (true, false);
}
else
{
const bool cmd = modifiers.isCommandDown();
item->setSelected ((! cmd) || ! item->isSelected(), ! cmd);
}
}
示例2: modifierKeysChanged
void Ambix_encoderAudioProcessorEditor::modifierKeysChanged(const ModifierKeys &modifiers)
{
if (modifiers.isShiftDown())
{
sld_el->setColour (Slider::thumbColourId, Colours::black);
sld_el->setEnabled(false);
}
else
{
sld_el->setColour (Slider::thumbColourId, Colours::grey);
sld_el->setEnabled(true);
}
if (modifiers.isCtrlDown())
{
sld_az->setColour (Slider::thumbColourId, Colours::black);
sld_az->setEnabled(false);
}
else
{
sld_az->setColour (Slider::thumbColourId, Colours::grey);
sld_az->setEnabled(true);
}
}
示例3: mouseDrag
void HoaMap::mouseDrag (const MouseEvent &event)
{
Point<float> mouse = event.getPosition().toFloat();
Point<float> newPos;
ModifierKeys modifierKey = event.mods;
// conversion en cartesien :
//mouse.applyTransform(AffineTransform::translation(m_padding, m_padding));
mouse.applyTransform(AffineTransform::fromTargetPoints(0, 0, -1, 1,
getPadWidth(), 0, 1, 1,
getPadWidth(), getPadWidth(), 1, -1));
newPos = mouse;
if (m_sourcePointed >= 0 && m_sourcePointed < m_nbSources) {
setMouseCursor(MouseCursor::DraggingHandCursor);
m_sources_dragState[m_sourcePointed] = -1; // reset dragging state
m_sources_ValueChanged[m_sourcePointed] = 1;
if (modifierKey.isShiftDown()) { // constrain move to distance
setPolarCoordinates(m_sourcePointed, Tools::radius(newPos.x, newPos.y), m_sources[m_sourcePointed].getAzimuth());
}
else if (modifierKey.isCtrlDown()) { // constrain move to angle
setPolarCoordinates(m_sourcePointed, m_sources[m_sourcePointed].getRadius(), Tools::angle(newPos.x, newPos.y));
}
else {
setCartesianCoordinates(m_sourcePointed, newPos.x, newPos.y, sendNotificationSync);
}
}
}
示例4: selectRowsBasedOnModifierKeys
void ListBox::selectRowsBasedOnModifierKeys (const int row,
const ModifierKeys& mods,
const bool isMouseUpEvent)
{
if (multipleSelection && mods.isCommandDown())
{
flipRowSelection (row);
}
else if (multipleSelection && mods.isShiftDown() && lastRowSelected >= 0)
{
selectRangeOfRows (lastRowSelected, row);
}
else if ((! mods.isPopupMenu()) || ! isRowSelected (row))
{
selectRowInternal (row, false, ! (multipleSelection && (! isMouseUpEvent) && isRowSelected (row)), true);
}
}
示例5: keyPressed
bool ScumblerComponent::keyPressed(const KeyPress& key)
{
bool retval = false;
if (key.isKeyCode(KeyPress::tabKey))
{
ModifierKeys mod = key.getModifiers();
if (mod.isShiftDown())
{
fScumbler->ActivatePreviousTrack();
}
else
{
fScumbler->ActivateNextTrack();
}
retval = true;
}
else
{
retval = false;
}
return retval;
}