当前位置: 首页>>代码示例>>C++>>正文


C++ KeyEventUnrecPtr类代码示例

本文整理汇总了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();
   }
}
开发者ID:msteners,项目名称:KabalaEngine,代码行数:7,代码来源:KEApplicationStartScreen.cpp

示例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;
       }
   }
开发者ID:danguilliams,项目名称:OpenSGToolbox,代码行数:25,代码来源:07AnimationGroup.cpp

示例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);
    }
}
开发者ID:Langkamp,项目名称:OpenSGToolbox,代码行数:31,代码来源:OSGInternalWindow.cpp

示例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;
       }
   }
开发者ID:msteners,项目名称:OpenSGToolbox,代码行数:27,代码来源:02TransformAnimation.cpp

示例5: keyPressed

 virtual void keyPressed(const KeyEventUnrecPtr e)
 {
     if(e->getKey() == KeyEvent::KEY_Q && e->getModifiers() & KeyEvent::KEY_MODIFIER_CONTROL)
     {
         TutorialWindow->closeWindow();
     }
 }
开发者ID:Langkamp,项目名称:OpenSGToolbox,代码行数:7,代码来源:04ShaderAnimation.cpp

示例6:

void DefaultTreeCellEditor::DefaultTextFieldEditorListener::keyPressed(const KeyEventUnrecPtr e)
{
	if(e->getKey() == KeyEvent::KEY_ESCAPE ||
		e->getKey() == KeyEvent::KEY_CANCEL)
	{
		_DefaultTreeCellEditor->cancelCellEditing();
	}
}
开发者ID:Langkamp,项目名称:OpenSGToolbox,代码行数:8,代码来源:OSGDefaultTreeCellEditor.cpp

示例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()));
     }
 }
开发者ID:Langkamp,项目名称:OpenSGToolbox,代码行数:11,代码来源:23RadialFieldParticleAffector.cpp

示例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
        {

        }
    }
开发者ID:Langkamp,项目名称:OpenSGToolbox,代码行数:12,代码来源:20RocketLauncher.cpp

示例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);
        }
    }
开发者ID:rdgoetz,项目名称:OpenSGToolbox,代码行数:13,代码来源:07AgeSizeParticleAffector.cpp

示例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;
       }
    }
开发者ID:Langkamp,项目名称:OpenSGToolbox,代码行数:50,代码来源:04XMLSoundLoading.cpp

示例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);
     }
 }
开发者ID:danguilliams,项目名称:OpenSGToolbox,代码行数:15,代码来源:15FCFileTypeIO.cpp

示例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;
    }
开发者ID:danguilliams,项目名称:OpenSGToolbox,代码行数:16,代码来源:05aQuadSequenceParticleDrawer(AgeFunction).cpp

示例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;
	   }
   }
开发者ID:Langkamp,项目名称:OpenSGToolbox,代码行数:17,代码来源:15LoadXMLAnimation.cpp

示例14:

void GenericFieldEditor::TextFieldListener::keyTyped       (const KeyEventUnrecPtr    e)
{
    if(e->getKey() == KeyEvent::KEY_ESCAPE)
    {
        _GenericFieldEditor->cancelEditing();
        _GenericFieldEditor->startEditing();
    }
}
开发者ID:msteners,项目名称:OpenSGToolbox,代码行数:8,代码来源:OSGGenericFieldEditor.cpp

示例15: disconnect

void Slider::KnobDraggedListener::keyTyped(const KeyEventUnrecPtr e)
{
	if(e->getKey() == KeyEvent::KEY_ESCAPE)
	{
		_Slider->setValue(_InitialValue);
        disconnect();
	}
}
开发者ID:Langkamp,项目名称:OpenSGToolbox,代码行数:8,代码来源:OSGSlider.cpp


注:本文中的KeyEventUnrecPtr类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。