本文整理汇总了C++中KeyEventUnrecPtr类的典型用法代码示例。如果您正苦于以下问题:C++ KeyEventUnrecPtr类的具体用法?C++ KeyEventUnrecPtr怎么用?C++ KeyEventUnrecPtr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KeyEventUnrecPtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void ApplicationStartScreen::StartScreenKeyListener::keyTyped(const KeyEventUnrecPtr e)
{
if(e->getKey() == KeyEvent::KEY_Q && e->getModifiers() & KeyEvent::KEY_MODIFIER_COMMAND)
{
MainApplication::the()->exit();
}
}
示例2: keyPressed
virtual void keyPressed(const KeyEventUnrecPtr e)
{
if(e->getKey() == KeyEvent::KEY_Q && e->getModifiers() & KeyEvent::KEY_MODIFIER_COMMAND)
{
TutorialWindow->closeWindow();
}
switch(e->getKey())
{
case KeyEvent::KEY_SPACE:
TheAnimationGroup->pause(!TheAnimationGroup->isPaused());
break;
case KeyEvent::KEY_ENTER:
TheAnimationGroup->attachUpdateProducer(TutorialWindow->editEventProducer());
TheAnimationGroup->start();
break;
case KeyEvent::KEY_MINUS:
TheAnimationGroup->setScale(osgMax(TheAnimationGroup->getScale()-0.1f, 0.0f));
break;
case KeyEvent::KEY_PLUS:
case KeyEvent::KEY_EQUALS:
TheAnimationGroup->setScale(osgMax(TheAnimationGroup->getScale()+0.1f, 0.0f));
break;
}
}
示例3: keyPressed
void InternalWindow::keyPressed(const KeyEventUnrecPtr e)
{
if(!getLockInput())
{
//Check for Accelerator Keys
UInt32 RelevantModifiers = (e->getModifiers() & KeyEvent::KEY_MODIFIER_ALT) |
(e->getModifiers() & KeyEvent::KEY_MODIFIER_CONTROL) |
(e->getModifiers() & KeyEvent::KEY_MODIFIER_SHIFT) |
(e->getModifiers() & KeyEvent::KEY_MODIFIER_META);
KeyAcceleratorMapItor MapItor = _KeyAcceleratorMap.find(KeyEvent::getHashable(e->getKey(), RelevantModifiers));
if(MapItor != _KeyAcceleratorMap.end())
{
(*MapItor).second->acceleratorTyped(KeyAcceleratorEvent::create(InternalWindowRefPtr(this), e->getTimeStamp(), e->getKey(), e->getModifiers()));
}
//Send Key event to Component that has Focus
//If there is not Focused Component then do nothing
if(getFocusedComponent() != NULL &&
getFocusedComponent() != this)
{
getFocusedComponent()->keyPressed(e);
ComponentContainerRefPtr ParentContainer(getFocusedComponent()->getParentContainer());
while(ParentContainer != NULL &&
ParentContainer != this)
{
ParentContainer->keyPressed(e);
ParentContainer = dynamic_cast<ComponentContainer*>(ParentContainer->getParentContainer());
}
}
Component::keyPressed(e);
}
}
示例4: keyPressed
virtual void keyPressed(const KeyEventUnrecPtr e)
{
if(e->getKey() == KeyEvent::KEY_Q && e->getModifiers() & KeyEvent::KEY_MODIFIER_COMMAND)
{
TutorialWindow->closeWindow();
}
switch(e->getKey())
{
case KeyEvent::KEY_SPACE:
TheAnimation->pause(!TheAnimation->isPaused());
break;
case KeyEvent::KEY_ENTER:
TheAnimation->attachUpdateProducer(TutorialWindow->editEventProducer());
TheAnimation->start();
break;
case KeyEvent::KEY_1:
dynamic_pointer_cast<FieldAnimation>(TheAnimation)->setInterpolationType(Animator::STEP_INTERPOLATION);
break;
case KeyEvent::KEY_2:
dynamic_pointer_cast<FieldAnimation>(TheAnimation)->setInterpolationType(Animator::LINEAR_INTERPOLATION);
break;
case KeyEvent::KEY_3:
dynamic_pointer_cast<FieldAnimation>(TheAnimation)->setInterpolationType(Animator::CUBIC_INTERPOLATION);
break;
}
}
示例5: keyPressed
virtual void keyPressed(const KeyEventUnrecPtr e)
{
if(e->getKey() == KeyEvent::KEY_Q && e->getModifiers() & KeyEvent::KEY_MODIFIER_CONTROL)
{
TutorialWindow->closeWindow();
}
}
示例6:
void DefaultTreeCellEditor::DefaultTextFieldEditorListener::keyPressed(const KeyEventUnrecPtr e)
{
if(e->getKey() == KeyEvent::KEY_ESCAPE ||
e->getKey() == KeyEvent::KEY_CANCEL)
{
_DefaultTreeCellEditor->cancelCellEditing();
}
}
示例7: keyPressed
virtual void keyPressed(const KeyEventUnrecPtr e)
{
if(e->getKey() == KeyEvent::KEY_Q && e->getModifiers() & KeyEvent::KEY_MODIFIER_CONTROL)
{
TutorialWindow->closeWindow();
}
if(e->getKey() == KeyEvent::KEY_R)
{
ExampleRadialAffector->setMagnitude(-(ExampleRadialAffector->getMagnitude()));
}
}
示例8: keyPressed
virtual void keyPressed(const KeyEventUnrecPtr e)
{
if(e->getKey() == KeyEvent::KEY_Q && e->getModifiers() & KeyEvent::KEY_MODIFIER_CONTROL)
{
TutorialWindow->closeWindow();
}
if(e->getKey() == KeyEvent::KEY_B)//generate particles when clicked
{
}
}
示例9: keyPressed
virtual void keyPressed(const KeyEventUnrecPtr e)
{
if(e->getKey() == KeyEvent::KEY_Q && e->getModifiers() & KeyEvent::KEY_MODIFIER_COMMAND)
{
TutorialWindow->closeWindow();
}
if(e->getKey() == KeyEvent::KEY_B)//generate particles when clicked
{
//Attach the Generator to the Particle System
ExampleParticleSystem->pushToGenerators(ExampleBurstGenerator);
}
}
示例10: keyTyped
virtual void keyTyped(const KeyEventUnrecPtr e)
{
if(e->getKey() == KeyEvent::KEY_Q && e->getModifiers() & KeyEvent::KEY_MODIFIER_CONTROL)
{
TheWindowEventProducer->closeWindow();
}
switch(e->getKey())
{
case KeyEvent::KEY_1:
case KeyEvent::KEY_2:
case KeyEvent::KEY_3:
case KeyEvent::KEY_4:
case KeyEvent::KEY_5:
case KeyEvent::KEY_6:
case KeyEvent::KEY_7:
case KeyEvent::KEY_8:
case KeyEvent::KEY_9:
{
UInt8 Index(e->getKeyChar() - '1');
if(Index < Sounds.size())
{
Sounds[Index]->play();
}
}
break;
case KeyEvent::KEY_P:
SoundGroups[0]->pause();
break;
case KeyEvent::KEY_U:
SoundGroups[0]->unpause();
break;
case KeyEvent::KEY_MINUS:
{
Real32 Volume(SoundGroups[0]->getVolume());
Volume -= 0.1;
if(Volume < 0.0) Volume = 0.0;
SoundGroups[0]->setVolume(Volume);
}
break;
case KeyEvent::KEY_EQUALS:
{
Real32 Volume(SoundGroups[0]->getVolume());
Volume += 0.1;
if(Volume > 1.0) Volume = 1.0;
SoundGroups[0]->setVolume(Volume);
}
break;
}
}
示例11: keyPressed
virtual void keyPressed(const KeyEventUnrecPtr e)
{
if(e->getKey() == KeyEvent::KEY_Q && e->getModifiers() & KeyEvent::KEY_MODIFIER_COMMAND)
{
TutorialWindow->closeWindow();
}
if(e->getKey() == KeyEvent::KEY_S)
{
mgr->setStatistics(true);
}
if(e->getKey() == KeyEvent::KEY_A)
{
mgr->setStatistics(false);
}
}
示例12: keyTyped
virtual void keyTyped(const KeyEventUnrecPtr e)
{ // changes the sequence ordering
if (e->getKey() == KeyEvent::KEY_1)
{
AgeFunc->setSequenceOrder(AgeParticleFunction::CYCLE);
}
else if (e->getKey() == KeyEvent::KEY_2)
{
AgeFunc->setSequenceOrder(AgeParticleFunction::REVERSE_CYCLE);
}
else if (e->getKey() == KeyEvent::KEY_3)
{
AgeFunc->setSequenceOrder(AgeParticleFunction::CUSTOM);
}
else return;
}
示例13: keyPressed
virtual void keyPressed(const KeyEventUnrecPtr e)
{
//Exit
if(e->getKey() == KeyEvent::KEY_Q && e->getModifiers() & KeyEvent::KEY_MODIFIER_CONTROL)
{
TutorialWindow->closeWindow();
}
//Toggle animation
if(e->getKey() == KeyEvent::KEY_SPACE)
{
if(animationPaused)
animationPaused = false;
else
animationPaused = true;
}
}
示例14:
void GenericFieldEditor::TextFieldListener::keyTyped (const KeyEventUnrecPtr e)
{
if(e->getKey() == KeyEvent::KEY_ESCAPE)
{
_GenericFieldEditor->cancelEditing();
_GenericFieldEditor->startEditing();
}
}
示例15: disconnect
void Slider::KnobDraggedListener::keyTyped(const KeyEventUnrecPtr e)
{
if(e->getKey() == KeyEvent::KEY_ESCAPE)
{
_Slider->setValue(_InitialValue);
disconnect();
}
}