Partially revert BGE bug fix #8863: don't send keyboard sensor positive pulse on level, this would badly interfere with keyboard sensors controlling set scene/restart scene actuators. Only send negative pulse on level to stop actuators after scene suspend

This commit is contained in:
Benoit Bolsee 2008-05-02 15:47:08 +00:00
parent b846e7a3bf
commit f0a41d9d97
2 changed files with 17 additions and 8 deletions

@ -169,8 +169,10 @@ bool SCA_KeyboardSensor::Evaluate(CValue* eventval)
{ {
if (m_val == 0) if (m_val == 0)
{ {
m_val = 1; //see comment below
result = true; //m_val = 1;
//result = true;
;
} }
} else } else
{ {
@ -220,10 +222,15 @@ bool SCA_KeyboardSensor::Evaluate(CValue* eventval)
{ {
if (m_val == 0) if (m_val == 0)
{ {
// this may occur during a scene suspend, the keyboard //hmm, this abnormal situation may occur in the following cases:
// press was not captured, do it now //- the key was pressed while the scene was suspended
m_val = 1; //- this is a new scene and the key is active from the start
result = true; //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;
;
} }
} }
} }

@ -164,8 +164,10 @@ bool SCA_MouseSensor::Evaluate(CValue* event)
{ {
if (m_val == 0) if (m_val == 0)
{ {
m_val = 1; //dangerous
result = true; //m_val = 1;
//result = true;
;
} }
} else } else
{ {