Partially revert BGE bug fix #8863: don't send keyboard sensor positive pulse on...
authorBenoit Bolsee <benoit.bolsee@online.be>
Fri, 2 May 2008 15:47:08 +0000 (15:47 +0000)
committerBenoit Bolsee <benoit.bolsee@online.be>
Fri, 2 May 2008 15:47:08 +0000 (15:47 +0000)
source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
source/gameengine/GameLogic/SCA_MouseSensor.cpp

index 8a12bd298c287a29abcccee461aa72f3073ba9bb..f13b1bcf4c991a0b801324ea7f54d6c87a100999 100644 (file)
@@ -169,8 +169,10 @@ bool SCA_KeyboardSensor::Evaluate(CValue* eventval)
                                {
                                        if (m_val == 0)
                                        {
-                                               m_val = 1;
-                                               result = true;
+                                               //see comment below
+                                               //m_val = 1;
+                                               //result = true;
+                                               ;
                                        }
                                } else
                                {
@@ -220,10 +222,15 @@ bool SCA_KeyboardSensor::Evaluate(CValue* eventval)
                                        {
                                                if (m_val == 0)
                                                {
-                                                       // this may occur during a scene suspend, the keyboard
-                                                       // press was not captured, do it now
-                                                       m_val = 1;
-                                                       result = true;
+                                                       //hmm, this abnormal situation may occur in the following cases:
+                                                       //- the key was pressed while the scene was suspended
+                                                       //- this is a new scene and the key is active from the start
+                                                       //In the second case, it's dangerous to activate the sensor
+                                                       //(think of a key to go to next scene)
+                                                       //What we really need is a edge/level flag in the key sensor
+                                                       //m_val = 1;
+                                                       //result = true;
+                                                       ;
                                                }
                                        }
                                }
index d8894ff593ce4f5786c6f92516bef32297a62763..8810b7470ed152974c75148b1b163ab6145d3d6e 100644 (file)
@@ -164,8 +164,10 @@ bool SCA_MouseSensor::Evaluate(CValue* event)
                                        {
                                                if (m_val == 0)
                                                {
-                                                       m_val = 1;
-                                                       result = true;
+                                                       //dangerous
+                                                       //m_val = 1;
+                                                       //result = true;
+                                                       ;
                                                }
                                        } else
                                        {