Revision: 2757
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2757&view=rev
Author:   ulteq
Date:     2012-05-30 17:25:26 +0000 (Wed, 30 May 2012)
Log Message:
-----------
added isKeyDownValueBounce method

Modified Paths:
--------------
    trunk/source/main/utils/InputEngine.cpp
    trunk/source/main/utils/InputEngine.h

Modified: trunk/source/main/utils/InputEngine.cpp
===================================================================
--- trunk/source/main/utils/InputEngine.cpp     2012-05-30 15:59:00 UTC (rev 
2756)
+++ trunk/source/main/utils/InputEngine.cpp     2012-05-30 17:25:26 UTC (rev 
2757)
@@ -2421,6 +2421,18 @@
        return this->mKeyboard->isKeyDown(key);
 }
 
+bool InputEngine::isKeyDownValueBounce(OIS::KeyCode mod, float time)
+{
+       if(event_times[-mod] > 0)
+               return false;
+       else
+       {
+               bool res = isKeyDown(mod);
+               if(res) event_times[-mod] = time;
+               return res;
+       }
+}
+
 String InputEngine::getDeviceName(event_trigger_t evt)
 {
        switch(evt.eventtype)

Modified: trunk/source/main/utils/InputEngine.h
===================================================================
--- trunk/source/main/utils/InputEngine.h       2012-05-30 15:59:00 UTC (rev 
2756)
+++ trunk/source/main/utils/InputEngine.h       2012-05-30 17:25:26 UTC (rev 
2757)
@@ -432,6 +432,7 @@
        bool setup(Ogre::String hwnd, bool capture=false, bool 
capturemouse=false, int grabMode=0, bool captureKbd=true);
        Ogre::String getKeyForCommand(int eventID);
        bool isKeyDown(OIS::KeyCode mod);
+       bool isKeyDownValueBounce(OIS::KeyCode mod, float time=0.2f);
 
        std::map<int, std::vector<event_trigger_t> > &getEvents() { return 
events; };
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rigsofrods-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel

Reply via email to