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


C++ KeyEventUnrecPtr::getKey方法代码示例

本文整理汇总了C++中KeyEventUnrecPtr::getKey方法的典型用法代码示例。如果您正苦于以下问题:C++ KeyEventUnrecPtr::getKey方法的具体用法?C++ KeyEventUnrecPtr::getKey怎么用?C++ KeyEventUnrecPtr::getKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KeyEventUnrecPtr的用法示例。


在下文中一共展示了KeyEventUnrecPtr::getKey方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: keyPressed

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

示例2: 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

示例3: keyTyped

    virtual void keyTyped(const KeyEventUnrecPtr e)
    {
        if(e->getKey()== KeyEvent::KEY_1) // Use the Point Drawer
        {

        }

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

示例4:

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

示例5: disconnect

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

示例6: 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

示例7: 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
            Example1ParticleSystem->pushToGenerators(ExampleBurstGenerator);

            Example2ParticleSystem->pushToGenerators(Example2BurstGenerator);


        }
    }
开发者ID:danguilliams,项目名称:OpenSGToolbox,代码行数:17,代码来源:06Explosion.cpp

示例8: 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;
        }

        //Toggle bind pose
        if(e->getKey() == KeyEvent::KEY_B)
        {
            //Toggle skeleton
            if(dynamic_cast<SkeletonDrawable*>(SkeletonNode->getCore())->getDrawBindPose() == false)
            {
                dynamic_cast<SkeletonDrawable*>(SkeletonNode->getCore())->setDrawBindPose(true);
            } 
            else
            {
                dynamic_cast<SkeletonDrawable*>(SkeletonNode->getCore())->setDrawBindPose(false);
            }
        }

        //Toggle current pose
        if(e->getKey() == KeyEvent::KEY_P)
        {
            //Toggle skeleton
            if(dynamic_cast<SkeletonDrawable*>(SkeletonNode->getCore())->getDrawPose() == false)
            {
                dynamic_cast<SkeletonDrawable*>(SkeletonNode->getCore())->setDrawPose(true);
            } 
            else
            {
                dynamic_cast<SkeletonDrawable*>(SkeletonNode->getCore())->setDrawPose(false);
            }
        }
    }
开发者ID:Langkamp,项目名称:OpenSGToolbox,代码行数:45,代码来源:12SkeletonAnimation.cpp

示例9: disconnect

void InternalWindow::TitlebarDraggedListener::keyPressed(const KeyEventUnrecPtr e)
{
    if(e->getKey() == KeyEvent::KEY_ESCAPE)
    {
        disconnect();

        //Reset the Window to it's original Position
        _InternalWindow->setPosition(_WindowStartPosition);
    }
}
开发者ID:Langkamp,项目名称:OpenSGToolbox,代码行数:10,代码来源:OSGInternalWindow.cpp

示例10: if

void InternalWindow::PopupMenuInteractionListener::keyPressed(const KeyEventUnrecPtr e)
{
    if(e->getKey() == KeyEvent::KEY_ESCAPE)
    {
        _InternalWindow->destroyPopupMenu();
    }
    else if(e->getKey() == KeyEvent::KEY_UP)
    {
        _InternalWindow->getMFActivePopupMenus()->front()->setSelection( _InternalWindow->getMFActivePopupMenus()->front()->getSelectionIndex() -1 );
    }
    else if(e->getKey() == KeyEvent::KEY_DOWN)
    {
        _InternalWindow->getMFActivePopupMenus()->front()->setSelection( _InternalWindow->getMFActivePopupMenus()->front()->getSelectionIndex() +1 );
    }
    else if(e->getKey() == KeyEvent::KEY_ENTER && _InternalWindow->getMFActivePopupMenus()->front()->getItem(_InternalWindow->getMFActivePopupMenus()->front()->getSelectionIndex()) != NULL)
    {
        _InternalWindow->getMFActivePopupMenus()->front()->getItem(_InternalWindow->getMFActivePopupMenus()->front()->getSelectionIndex())->activate();
        _InternalWindow->destroyPopupMenu();
    }
}
开发者ID:Langkamp,项目名称:OpenSGToolbox,代码行数:20,代码来源:OSGInternalWindow.cpp

示例11: 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_S:
          {
              allPhysicsBodies.push_back(buildSphere());
          }
          break;
     case KeyEvent::KEY_B:
          {
              allPhysicsBodies.push_back(buildBox());
          }
          break;
     case KeyEvent::KEY_E:
         makeExplosion(Pnt3f(0.0f,0.0f,-5.0f), 1280.0f);
         break;
     case KeyEvent::KEY_1:
         makeExplosion(Pnt3f(0.0f,0.0f,-5.0f), 20.0f);
         break;
     case KeyEvent::KEY_2:
         makeExplosion(Pnt3f(0.0f,0.0f,-5.0f), 80.0f);
         break;
     case KeyEvent::KEY_3:
         makeExplosion(Pnt3f(0.0f,0.0f,-5.0f), 320.0f);
         break;
     case KeyEvent::KEY_4:
         makeExplosion(Pnt3f(0.0f,0.0f,-5.0f), 1280.0f);
         break;
     case KeyEvent::KEY_5:
         makeExplosion(Pnt3f(0.0f,0.0f,-5.0f), 5120.0f);
         break;
     case KeyEvent::KEY_6:
         makeExplosion(Pnt3f(0.0f,0.0f,-5.0f), 20480.0f);
         break;
     }
 }
开发者ID:danguilliams,项目名称:OpenSGToolbox,代码行数:41,代码来源:05Explosion.cpp

示例12: keyTyped

    virtual void keyTyped(const KeyEventUnrecPtr e)
    {
        if(e->getKey()== KeyEvent::KEY_1) // Use the Point Drawer
        {
            ParticleNodeCore->setDrawer(ExamplePointParticleSystemDrawer);
        }

        if(e->getKey()== KeyEvent::KEY_2)//Use the Line Drawer for 2
        {
            ParticleNodeCore->setDrawer(ExampleLineParticleSystemDrawer);
        }

        if(e->getKey()== KeyEvent::KEY_3)//Use the Quad Drawer for 3
        {
            ParticleNodeCore->setDrawer(ExampleQuadParticleSystemDrawer);
        }
        if(e->getKey() == KeyEvent::KEY_F) //particles will be sorted from closest to the view point to the furthest
        {
            ParticleNodeCore->setSortingMode(ParticleSystemCore::FRONT_TO_BACK);
        }
        if(e->getKey() == KeyEvent::KEY_R) //particles will be sorted from furthest to the view point to the closest.
        {
            ParticleNodeCore->setSortingMode(ParticleSystemCore::BACK_TO_FRONT);
        }
        if(e->getKey() == KeyEvent::KEY_N) //particles will not be sorted
        {
            ParticleNodeCore->setSortingMode(ParticleSystemCore::NONE);
        }
    }
开发者ID:danguilliams,项目名称:OpenSGToolbox,代码行数:29,代码来源:14ParticleSorting.cpp

示例13: keyTyped

    virtual void keyTyped(const KeyEventUnrecPtr e)
    {
        UInt32 CHANGE_SOURCE;
        if(e->getKey()== KeyEvent::KEY_P)
        {

            CHANGE_SOURCE = QuadParticleSystemDrawer::NORMAL_POSITION_CHANGE;
        }

        else if(e->getKey()== KeyEvent::KEY_C)
        {
            CHANGE_SOURCE = QuadParticleSystemDrawer::NORMAL_VELOCITY_CHANGE;
        }

        else if(e->getKey()== KeyEvent::KEY_V)
        {
            CHANGE_SOURCE = QuadParticleSystemDrawer::NORMAL_VELOCITY;
        }

        else if(e->getKey()== KeyEvent::KEY_A)
        {
            CHANGE_SOURCE = QuadParticleSystemDrawer::NORMAL_ACCELERATION;
        }

        else  if(e->getKey()== KeyEvent::KEY_N)
        {
            CHANGE_SOURCE = QuadParticleSystemDrawer::NORMAL_PARTICLE_NORMAL;
        }

        else if(e->getKey()== KeyEvent::KEY_D)
        {
            CHANGE_SOURCE = QuadParticleSystemDrawer::NORMAL_VIEW_POSITION;
        }

        else if(e->getKey()== KeyEvent::KEY_S)
        {
            CHANGE_SOURCE = QuadParticleSystemDrawer::NORMAL_STATIC;
        }

        else  if(e->getKey()== KeyEvent::KEY_W)
        {
            CHANGE_SOURCE = QuadParticleSystemDrawer::NORMAL_VIEW_DIRECTION;
        }
        else {
            return;
        }
        ExampleParticleSystemDrawer->setNormalSource(CHANGE_SOURCE);

    }
开发者ID:rdgoetz,项目名称:OpenSGToolbox,代码行数:49,代码来源:07AgeSizeParticleAffector.cpp

示例14: keyPressed

   virtual void keyPressed(const KeyEventUnrecPtr e)
   {
       if(e->getKey() == KeyEvent::KEY_Q && e->getModifiers() & KeyEvent::KEY_MODIFIER_CONTROL)
       {
           TutorialWindow->closeWindow();
       }
       switch(e->getKey())
       {
       case KeyEvent::KEY_B:
           buildBox(Vec3f(10.0,10.0,10.0), Pnt3f((Real32)(rand()%100)-50.0,(Real32)(rand()%100)-50.0,25.0));
           break;
	   case KeyEvent::KEY_UP:
           _IsUpKeyDown = true;
		   break;
	   case KeyEvent::KEY_DOWN:
           _IsDownKeyDown = true;
		   break;
	   case KeyEvent::KEY_LEFT:
           _IsLeftKeyDown = true;
		   break;
	   case KeyEvent::KEY_RIGHT:
           _IsRightKeyDown = true;
           break;
       case KeyEvent::KEY_D:
            {
                if(PhysDrawableNode->getTravMask())
                {
                    PhysDrawableNode->setTravMask(TypeTraits<UInt32>::getMin());
                }
                else
                {
                    PhysDrawableNode->setTravMask(TypeTraits<UInt32>::getMax());
                }
            }
            break;
       }
   }
开发者ID:Langkamp,项目名称:OpenSGToolbox,代码行数:37,代码来源:04ZeroGravityShip.cpp

示例15: 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_S:
             {
                 buildSphere();
             }
             break;
         case KeyEvent::KEY_B:
             {
                 buildBox();
             }
             break;
         case KeyEvent::KEY_T:
             {
                 buildTriMesh();
             }
             break;
         case KeyEvent::KEY_D:
             {
                 if(PhysDrawableNode->getTravMask())
                 {
                     PhysDrawableNode->setTravMask(TypeTraits<UInt32>::getMin());
                 }
                 else
                 {
                     PhysDrawableNode->setTravMask(TypeTraits<UInt32>::getMax());
                 }
             }
             break;
     }
 }
开发者ID:msteners,项目名称:OpenSGToolbox,代码行数:37,代码来源:01SimplePhysics.cpp


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