本文整理汇总了C++中ModifierKeys::isCtrlDown方法的典型用法代码示例。如果您正苦于以下问题:C++ ModifierKeys::isCtrlDown方法的具体用法?C++ ModifierKeys::isCtrlDown怎么用?C++ ModifierKeys::isCtrlDown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModifierKeys
的用法示例。
在下文中一共展示了ModifierKeys::isCtrlDown方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}
示例2: 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);
}
}
}
示例3: mouseDown
void ChannelStripComponent::mouseDown(const MouseEvent &) {
ModifierKeys modifiers = ModifierKeys::getCurrentModifiersRealtime();
// check the mod keys ..
if (modifiers.isPopupMenu() || modifiers.isCtrlDown())
{
ScopedPointer<PopupMenu> arrangeMenu_ = new PopupMenu();
arrangeMenu_->clear();
arrangeMenu_->addCommandItem(&_commands, MainWindow::showArrangement);
arrangeMenu_->show();
}
}
示例4: buttonStateChanged
void TrackMixerComponent::buttonStateChanged(Button* button)
{
// if button is clicked mute or solo track
if(button == _muteButton)
_engine.getMixer();
else if(button == _soloButton)
_engine.getMixer()->soloTrack(_trackID);
ModifierKeys modifiers = ModifierKeys::getCurrentModifiersRealtime();
// menu for adding tracks
if (modifiers.isPopupMenu() || modifiers.isCtrlDown())
{
ScopedPointer<PopupMenu> arrangeMenu_ = new PopupMenu();
arrangeMenu_->clear();
arrangeMenu_->addCommandItem(&_commands, ProjectManager::addTrack);
arrangeMenu_->show();
}
}
示例5: mouseDown
void TrackComponent::mouseDown(const MouseEvent &e) {
ModifierKeys modifiers = ModifierKeys::getCurrentModifiersRealtime();
int posX;
// check the mod keys ..
if (modifiers.isPopupMenu() || modifiers.isCtrlDown())
{
ScopedPointer<PopupMenu> trackMenu_ = new PopupMenu();
trackMenu_->clear();
trackMenu_->addCommandItem(&_commands, MainWindow::showMixer);
trackMenu_->addItem(1, "Add Region", true);
MouseEvent ev = e.getEventRelativeTo(this);
for(auto region : _regionComponents)
{
posX = ev.x;
region->setBroughtToFrontOnMouseClick(true);
if(region->getPositionX() < posX && posX < (region->getPositionX() + region->getRegionWidth()))
{
trackMenu_->addItem(2, "Remove Region", true);
}
}
switch (trackMenu_->show())
{
case 1:
{
FileChooser chooser("Select an audio file to add...",
File::nonexistent,
"*.wav; *aif; *.flac");
if (chooser.browseForFileToOpen()) {
File audioFile(chooser.getResult());
const String fileString = audioFile.getFullPathName();
String format;
if (fileString.contains(".wav"))
format = "WAV";
else if (fileString.contains(".aif") || fileString.contains(".aiff"))
format = "AIFF";
else if (fileString.contains(".flac"))
format = "FLAC";
AudioFormatManager formatManager;
formatManager.registerBasicFormats();
AudioFormatReader* reader = formatManager.createReaderFor(audioFile);
Audio::Region* region = new Audio::SampleRegion(reader, 1, &audioFile);
Point<int> position = e.getPosition();
int x = position.getX();
if (x > _mixerOffset)
{
int64 samplesRange = secondsToSamples(100, _sampleRate);
int64 positionSamples = pixelsToSamples(x - _mixerOffset, 100 * _pixelsPerClip, samplesRange);
_track->add(positionSamples, region);
createRegionGUI(x, region, formatManager, audioFile);
getParentComponent()->resized();
}
else if (x < _mixerOffset)
{
_track->add(0, region);
createRegionGUI(_mixerOffset, region, formatManager, audioFile);
getParentComponent()->resized();
}
}
}
break;
case 2:
{
CriticalSection critical;
critical.enter();
for(size_t i = 0; i < _regionComponents.size(); ++i)
{
Rectangle<int> bounds_ = _regionComponents.at(i)->getBounds();
posX = ev.x;
if((int)_regionComponents.at(i)->getPositionX() < posX && posX < ((int)_regionComponents.at(i)->getPositionX() + (int)_regionComponents.at(i)->getRegionWidth()))
{
_track->remove(_regionComponents.at(i)->getRegion(), _posX.at(i));
std::vector<RegionComponent*>::iterator regit = _regionComponents.begin() + i;
RegionComponent* component = _regionComponents.at(i);
removeChildComponent(_regionComponents.at(i));
_regionComponents.erase(regit);
delete component;
_regions.erase(_posX.at(i));
std::vector<int64>::iterator posit = _posX.begin() + i;;
_posX.erase(posit);
std::vector<int64>::iterator sampsit = _sizeSamps.begin() + i;;
_sizeSamps.erase(sampsit);
}
}
critical.exit();
}
default:
break;
}
}
}